Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten copy&paste commands needed to get a Windows dev env #10299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions doc/21-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -1736,12 +1736,7 @@ and don't care for the details,

1. ensure there are 35 GB free space on C:
2. run the following in an administrative Powershell:
1. Windows Server only:
`Enable-WindowsOptionalFeature -FeatureName NetFx3ServerFeatures -Online`
2. `Enable-WindowsOptionalFeature -FeatureName NetFx3 -Online`
(reboot when asked!)
3. `powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-Expression (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Icinga/icinga2/master/doc/win-dev.ps1')"`
(will take some time)
`powershell -nop -ep bypass -c "iex (iwr 'https://raw.githubusercontent.com/Icinga/icinga2/master/doc/win-dev.ps1')"`

This installs everything needed for cloning and building Icinga 2
on the command line (Powershell) as follows:
Expand Down
13 changes: 13 additions & 0 deletions doc/win-dev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ function Install-Exe {
}


function Needs-WinFeatureRestart($feature) {
(Enable-WindowsOptionalFeature -FeatureName $feature -Online).RestartNeeded
}


$isServer = (Get-CimInstance -ClassName Win32_OperatingSystem).Caption -match 'Windows Server'
$serverNeedsRestart = $isServer -and (Needs-WinFeatureRestart NetFx3ServerFeatures)
$needsRestart = Needs-WinFeatureRestart NetFx3

if ($serverNeedsRestart -or $needsRestart) {
throw 'Restart needed'
}

try {
Get-Command choco
} catch {
Expand Down
Loading