Advertisement
mariussm

Update-PowerShellProfile

Oct 16th, 2014
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Function to update the powershellprofile from the internet
  2. function Update-PowerShellProfile() {
  3.     [CmdletBinding()]
  4.     Param()
  5.     Write-Verbose "Updating PowerShell profile"
  6.    
  7.     if(!(Test-Path (Split-Path $profile))) {
  8.         Write-Verbose ("Profile path did not exist, creating {0}" -f (Split-Path $profile))
  9.         mkdir (Split-Path $profile)
  10.     }
  11.  
  12.     Write-Debug "Creating System.Net.WebClient"
  13.     $wc = New-Object System.Net.WebClient
  14.     Write-Debug "Downloading file http://pastebin.com/raw.php?i=tdySrDgz"
  15.     $wc.DownloadFile("http://pastebin.com/raw.php?i=tdySrDgz", $profile)
  16.    
  17.     Write-Output "Reload profile with the cmdlet:  . `$profile"
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement