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
$sourceuri = "ftp://speedtest.tele2.net/1MB.zip" | |
$targetpath = "C:\temp\1mb.zip" | |
$username = "anonymous" | |
$password = "anonymous" | |
# Create a FTPWebRequest object to handle the connection to the ftp server | |
$ftprequest = [System.Net.FtpWebRequest]::create($sourceuri) | |
# set the request's network credentials for an authenticated connection |
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
$sourceuri = "ftp://ftp.example.com/myfolder/myfile.xml" | |
$filePath = "C:\temp\myfile.xml" | |
$username = "user" | |
$password = "password" | |
# Create a FTPWebRequest object to handle the connection to the ftp server | |
$ftprequest = [System.Net.FtpWebRequest]::create($sourceuri) | |
$credentials = New-Object System.Net.NetworkCredential($username,$password) | |
# set the request's network credentials for an authenticated connection |
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
{ | |
"title": "Test tour", | |
"steps": [ | |
{ | |
"file": "Test-CodeTour.ps1", | |
"line": 4, | |
"description": "### Step 1\r\n\r\nThis is the first command in the script.\r\nIt will show you today's date. Simple as that.", | |
"contents": "\r\n# a script to test the CodeTour extension\r\n\r\nGet-Date\r\n\r\nfunction foo {\r\n Write-Output \"foo\"\r\n}\r\n\r\n# Call a function\r\nfoo\r\n\r\n" | |
}, | |
{ |
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
$options = @{ | |
AddToHistoryHandler = { | |
param( [string]$line) | |
return $line.Length -gt 3 -and $line[0] -ne ' ' -and $line[0] -ne ';' | |
} | |
} | |
Set-PSReadLineOption @options |