A powershell script to update Cloudflare DNS records in cloudflare.
Create a config file at ~/.ddns/config.json
and add your records to it. See config.json for an example.
Run the script to update the DDNS records:
C:\dev\ddns\update-ddns.ps1
The following powershell script will create a Scheduled Task which starts at logon of the current user and then runs daily at 8AM:
cd ~\Dev\Update-IPFilter
New-ScheduledTask `
-Action (New-ScheduledTaskAction `
-Execute (Get-Command pwsh).Path `
-Argument '-nologo -nop -ep bypass -w hidden -f update-ddns.ps1' `
-WorkingDirectory $PWD) `
-Trigger `
(New-ScheduledTaskTrigger -AtLogOn),
(New-ScheduledTaskTrigger -Daily -At (Get-Date '08:00')) | `
Register-ScheduledTask -TaskName 'Update DDNS' -Force
# Execute now:
Start-ScheduledTask -TaskName 'Update DDNS'
# Delete:
# Unregister-ScheduledTask -TaskName 'Update DDNS'