Skip to content

Instantly share code, notes, and snippets.

@KMConner
Created April 6, 2019 04:52
Show Gist options
  • Save KMConner/e312ca4d22ca07fe825b1a34754460dc to your computer and use it in GitHub Desktop.
Save KMConner/e312ca4d22ca07fe825b1a34754460dc to your computer and use it in GitHub Desktop.
Update mydns.jp address information using powershell
Param(
[Parameter(Mandatory = $true)]
[String] $UserName,
[Parameter(Mandatory = $true)]
[String] $Password
)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
$credential = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($UserName + ":" + $Password))
$client = [System.Net.WebClient]::new()
$client.Headers.Add([System.Net.HttpRequestHeader]::Authorization, "Basic " + $credential)
$page_content = $client.DownloadString("https://ipv4.mydns.jp/login.html")
echo $page_content
$page_content = $client.DownloadString("https://www.mydns.jp/login.html")
echo $page_content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment