@@ -71,24 +71,24 @@ function Install-Certificate($path, $password)
7171 return (Import-PfxCertificate @importArgs )
7272}
7373
74- function Grant-WinRMHttpsAccess ($certThumbprint )
75- {
76- $winRMArgs = @ {
77- ResourceURI = ' winrm/config/Listener'
78- SelectorSet = @ { Address = ' *' ; Transport = ' HTTPS' ; }
79- ValueSet = @ { Hostname = ' boltserver' ; CertificateThumbprint = $certThumbprint }
80- }
81- $instance = Set-WSManInstance @winRMArgs
82- Write-Information ($instance | Format-List | Out-String )
83- }
84-
85- function Set-WinRMHostConfiguration
86- {
87- # configure WinRM to use cert.pfx for SSL
88- $cert = Install-Certificate - Path ' spec/fixtures/ssl/cert.pfx' - Password ' bolt'
89- Write-Information ($cert | Format-List | Out-String )
90- Grant-WinRMHttpsAccess - CertThumbprint $cert.Thumbprint
91- }
74+ # function Grant-WinRMHttpsAccess($certThumbprint)
75+ # {
76+ # $winRMArgs = @{
77+ # ResourceURI = 'winrm/config/Listener'
78+ # SelectorSet = @{ Address = '*'; Transport = 'HTTPS'; }
79+ # ValueSet = @{ Hostname = 'boltserver'; CertificateThumbprint = $certThumbprint }
80+ # }
81+ # $instance = Set-WSManInstance @winRMArgs
82+ # Write-Information ($instance | Format-List | Out-String)
83+ # }
84+
85+ # function Set-WinRMHostConfiguration
86+ # {
87+ # # configure WinRM to use cert.pfx for SSL
88+ # $cert = Install-Certificate -Path 'spec/fixtures/ssl/cert.pfx' -Password 'bolt'
89+ # Write-Information ($cert | Format-List | Out-String)
90+ # Grant-WinRMHttpsAccess -CertThumbprint $cert.Thumbprint
91+ # }
9292
9393function Invoke-ScriptBlockWithRetry ([ScriptBlock ]$script , $failMessage , $successMessage , $retries = 15 , $timeout = 1 )
9494{
@@ -112,28 +112,28 @@ function Invoke-ScriptBlockWithRetry([ScriptBlock]$script, $failMessage, $succes
112112
113113}
114114
115- function Test-WinRMConfiguration ($userName , $password , $retries = 15 , $timeout = 1 )
116- {
117- $retryArgs = @ {
118- FailMessage = ' Failed to establish WinRM connection over SSL'
119- SuccessMessage = " Successfully established WinRM connection with $userName "
120- Retries = $retries
121- Timeout = $timeout
122- Script = {
123- $pass = ConvertTo-SecureString $password - AsPlainText - Force
124- $sessionArgs = @ {
125- ComputerName = ' localhost'
126- Credential = New-Object System.Management.Automation.PSCredential ($userName , $pass )
127- UseSSL = $true
128- SessionOption = New-PSSessionOption - SkipRevocationCheck - SkipCACheck
129- }
130-
131- if (New-PSSession @sessionArgs ) { return $true }
132- }
133- }
134-
135- Invoke-ScriptBlockWithRetry @retryArgs
136- }
115+ # function Test-WinRMConfiguration($userName, $password, $retries = 15, $timeout = 1)
116+ # {
117+ # $retryArgs = @{
118+ # FailMessage = 'Failed to establish WinRM connection over SSL'
119+ # SuccessMessage = "Successfully established WinRM connection with $userName"
120+ # Retries = $retries
121+ # Timeout = $timeout
122+ # Script = {
123+ # $pass = ConvertTo-SecureString $password -AsPlainText -Force
124+ # $sessionArgs = @{
125+ # ComputerName = 'localhost'
126+ # Credential = New-Object System.Management.Automation.PSCredential ($userName, $pass)
127+ # UseSSL = $true
128+ # SessionOption = New-PSSessionOption -SkipRevocationCheck -SkipCACheck
129+ # }
130+ #
131+ # if (New-PSSession @sessionArgs) { return $true }
132+ # }
133+ # }
134+ #
135+ # Invoke-ScriptBlockWithRetry @retryArgs
136+ # }
137137
138138# Ensure Puppet Ruby 5 / 6 takes precedence over system Ruby
139139function Set-ActiveRubyFromPuppet
@@ -151,8 +151,8 @@ function Set-ActiveRubyFromPuppet
151151$Pass = New-RandomPassword
152152$User = @ { UserName = $ENV: BOLT_WINRM_USER ; Password = $Pass }
153153New-LocalAdmin @User
154- Enable-PSRemoting
155- Set-WSManQuickConfig - Force
156- Set-WinRMHostConfiguration
157- Test-WinRMConfiguration @User | Out-Null
158- Write-Output " ::set-env name=BOLT_WINRM_PASSWORD::$pass "
154+ # Enable-PSRemoting
155+ # Set-WSManQuickConfig -Force
156+ # Set-WinRMHostConfiguration
157+ # Test-WinRMConfiguration @User | Out-Null
158+ # Write-Output "::set-env name=BOLT_WINRM_PASSWORD::$pass"
0 commit comments