Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Icinga/check_by_powershell
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e1e96d9254eb44eb5f0f5fc426bfbfe317dec5a1
Choose a base ref
..
head repository: Icinga/check_by_powershell
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5bbb91ebbb72b1d044c7a203b625f51ebda77e0e
Choose a head ref
Showing with 13 additions and 6 deletions.
  1. +13 −6 .github/workflows/go-windows.yml
19 changes: 13 additions & 6 deletions .github/workflows/go-windows.yml
Original file line number Diff line number Diff line change
@@ -27,21 +27,28 @@ jobs:
New-LocalUser -Name $env:TEST_USER_NAME -Password $pw -Description "GitHub Action Test User"
Add-LocalGroupMember -Group Administrators -Member $env:TEST_USER_NAME
# Already enabled
# Already enabled with a HTTPS listener
#Enable-PSRemoting -SkipNetworkProfileCheck -Force;
# Enable HTTP listener for testing
New-Item -Path WSMan:\LocalHost\Listener -Transport HTTP -Address * -Force
Get-ChildItem -Recurse WSMan:\LocalHost\Listener
& winrm set winrm/config/service/Auth '@{Basic="true"}'
& winrm set winrm/config/service '@{AllowUnencrypted="true"}'
& winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
# Read current cert
$certs = Get-ChildItem Cert:\LocalMachine\My
$certs
Export-Certificate -Cert $certs[0] -FilePath C:\temp\cert.pem
$https = Get-ChildItem WSMan:\Localhost\Listener | Where -Property Keys -eq "Transport=HTTP"
$certThumbprint = (Get-ChildItem ($https.PSPath + "\CertificateThumbprint")).Value
Get-ChildItem WSMan:\LocalHost\Listener
# Store cert as CA for check
$cert = Get-Item "Cert:\Localmachine\My\${certThumbprint}"
Export-Certificate -Cert $cert -FilePath C:\temp\cert.pem
Restart-Service winrm
# Should not be needed
#Restart-Service winrm
Test-WSMan -Computername localhost -Credential $cred -Authentication Negotiate