Skip to content

Instantly share code, notes, and snippets.

@TylerLeonhardt
Last active April 23, 2020 01:13
Show Gist options
  • Save TylerLeonhardt/aeda3dbf5b1854736fe8e1ada2e143dc to your computer and use it in GitHub Desktop.
Save TylerLeonhardt/aeda3dbf5b1854736fe8e1ada2e143dc to your computer and use it in GitHub Desktop.
Put this script in a `PowerShell` task in your Azure Pipelines YAML and the `PowerShell` task will use the daily build of PowerShell!
steps:
- powershell: |
Write-Host "Installing PowerShell Daily..."
# Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up.
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1
./install-powershell.ps1 -Destination $powerShellPath -Daily
# Using `prependpath` to update the PATH just for this build.
Write-Host "##vso[task.prependpath]$powerShellPath"
displayName: Install PowerShell Daily
- pwsh: '$PSVersionTable'
displayName: Display PowerShell version information
Write-Host "Installing PowerShell Daily..."
# Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up.
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1
./install-powershell.ps1 -Destination $powerShellPath -Daily
# Using `prependpath` to update the PATH just for this build.
Write-Host "##vso[task.prependpath]$powerShellPath"
@TylerLeonhardt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment