generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #775 from ministryofjustice/onr/DSOS-2724/2012-jum…
…pserver-prerequisites add component to upgrade 2012 r2 base image to Powershell 5.1
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: powershell_5_1 | ||
description: Component to install Windows Management Framework 5.1 on Windows Server 2012. This includes PowerShell 5.1 and will supercede Powershell 4.0 so we can use more modern commandlets. | ||
schemaVersion: 1.0 | ||
parameters: | ||
- Version: | ||
type: string | ||
default: 0.0.5 | ||
description: Component version (update this each time the file changes) | ||
- Platform: | ||
type: string | ||
default: "Windows" | ||
description: Platform. | ||
phases: | ||
- name: build | ||
steps: | ||
- name: InstallPowerShell_5_1 | ||
action: ExecutePowerShell | ||
inputs: | ||
commands: | ||
- | | ||
$PSMajorVersion = $PSVersionTable.PSVersion.Major | ||
if ( $PSMajorVersion -le 4 ) { | ||
Write-Host "Installing PowerShell 5.1" | ||
choco install -y powershell | ||
exit 3010 | ||
} else { | ||
Write-Host "PowerShell $PSMajorVersion is installed" | ||
exit 0 | ||
} |