Created
April 6, 2019 04:52
-
-
Save KMConner/e312ca4d22ca07fe825b1a34754460dc to your computer and use it in GitHub Desktop.
Update mydns.jp address information using powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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