Hello i hava a problem
I created sosm VM on azure to invoke coammands i need to install cert on my local machine.
It worked! but now i had a wrong Cloud Service name. i Created a nieuw service and a vm but i atatched the VHD of an existing system it is running.
But now i want to invoke a command an got an error that i dont have a certificate.
Example of my code for inatlling a cert on local machine:
$winRMCert = (Get-AzureVM -ServiceName $ServiceName -Name $VMName | select -ExpandProperty vm).DefaultWinRMCertificateThumbprint $AzureX509cert = Get-AzureCertificate -ServiceName $ServiceName -Thumbprint $winRMCert -ThumbprintAlgorithm sha1 $certTempFile = [IO.Path]::GetTempFileName() $AzureX509cert.Data | Out-File $certTempFile # Target The Cert That Needs To Be Imported $CertToImport = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $certTempFile $store = New-Object System.Security.Cryptography.X509Certificates.X509Store "Root", "LocalMachine" $store.Certificates.Count $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) $store.Add($CertToImport) $store.Close() Remove-Item $certTempFile
BTW this code works
after tring to run this code i get an error that my:
$winRMCert
is $NULL
after som tries and research i found out that my DefaultWinRmCertificateThumbprint empty is