The GoTo Community is currently experiencing some technical issues affecting new posts and comments. You may need to reload the page you are on before you can post a comment. We are actively working with our service provider and apologize for the frustration.
Forum Discussion
CS_HelpDesk
3 years agoGoTo Contributor
Remote Execution - PowerShell Script Repository
Welcome to the Remote Execution - Powershell Script Repository!
What is it? A library of scripts to help you execute automated tasks and manage your Central computers without having to access t...
CS_HelpDesk
3 years agoGoTo Contributor
Downloads file from a given URL to the working directory or to a specified folder.
$url = $null
$destination = 'C:\DistributedFiles'
$fileName = $null
$outFile = $fileName;
if (-Not $outFile)
{
$outFile = $url.Split('/')[-1];
$outFile = $outFile.Split('?')[0];
}
If (-Not (Test-Path -Path $destination -PathType Container))
{
New-Item -Path $destination -ItemType Container
}
$outPath = Join-Path -Path $destination -ChildPath $outFile
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $outPath)