![]() For example: $ sampleDebugValue = 45 Write-Host " $ sampleDebugValue " Import the certificate into Trusted Root Certification Authorities: Import-Certificate - Filepath " C:\remoting-certificate.cer " - CertStoreLocation " Cert:\LocalMachine\Root " Setting up Octopus for PowerShell debuggingĬreate a project with a “Run a Script” step that contains some PowerShell. Copy the exported certificate ( remoting-certificate.cer) from the remote machine to the machine that will be doing the debugging. In order to connect to the remote machine, the debugging machine must add the certificate to its Trusted Root Certification Authorities. We also need to export the certificate so that it can be trusted by the debugging machine: Export-Certificate - Cert $ certificate - FilePath " C:\remoting-certificate.cer " The remote machine requires a certificate, an HTTPS listener and a firewall rule to allow incoming requests on port 5986: $ dnsName = " 55.555.55.555 " # The IP address you are using to connect to the machine $ certificate = New-SelfSignedCertificate - CertstoreLocation Cert:\LocalMachine\My - DnsName " $ dnsName " New-Item - Path WSMan:\LocalHost\Listener - Transport HTTPS - Address * - CertificateThumbPrint $ certificate.Thumbprint –Force New-NetFirewallRule - DisplayName " Windows Remote Management (HTTPS-In) " - Name " Windows Remote Management (HTTPS-In) " - Profile Any - LocalPort 5986 - Protocol TCP ![]() To establish trust between the debugging machine and the remote machine let’s configure remoting over SSL. To enable PowerShell remoting on the remote machine: Enable-PSRemoting - SkipNetworkProfileCheck - Force PowerShell remoting must be enabled on the remote machine and configured for SSL and the trust established between the remote machine and the debugging machine. Some steps may be omitted when connecting to machines on the same subnet or domain. This guide demonstrates connecting via IP address to an untrusted machine on a public network. This guide provides details on how to debug PowerShell scripts while they are being deployed by Octopus Deploy to remote machines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |