Skip to content

Instantly share code, notes, and snippets.

@tjrobinson
Created June 22, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjrobinson/f16fcd0cdfb64029726c to your computer and use it in GitHub Desktop.
Save tjrobinson/f16fcd0cdfb64029726c to your computer and use it in GitHub Desktop.
install-psget.ps1 - suitable for use as part of a Group Policy Object
function Install-PsGet {
$Destination = "C:\Windows\System32\WindowsPowerShell\v1.0\Modules"
New-Item -Path ($Destination + "\PsGet\") -ItemType Directory -Force | Out-Null
Write-Host 'Downloading PsGet from https://github.com/psget/psget/raw/master/PsGet/PsGet.psm1'
$client = (New-Object Net.WebClient)
$client.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$client.DownloadFile("https://github.com/psget/psget/raw/master/PsGet/PsGet.psm1", $Destination + "\PsGet\PsGet.psm1")
Write-Host "PsGet is installed and ready to use" -Foreground Green
}
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
Start-Transcript -path C:\install-psget.log
Install-PsGet
Stop-Transcript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment