Hi
You get this error if you open the text file first then then copy it into powershell or ISE. The reason for this is the the line that is below
"#sleep between invoke SSH runs to ensure ONTAP is ready"
is all bunched up into one line and then the varible will be null because it wont run. When you open the file in ISE originally you will see it like this
Line 1 #Only return if shows as self-signed, had to reduce fields for ONTAP to return successfully
Line 2 #$GetCertificateCommand = "security certificate show -common-name $CommonName -serial $SerialNumber -ca $CertificateAuthority -type $Type -size $Size -start $StartDateDT -expiration $ExpirationDateDT -public-cert $PublicCertificate -country $Country -state $State -locality $Locality -organization $Organization -unit $OrganizationUnit -email-addr $EmailAddress -protocol $Protocol -hash-function $HashFunction -self-signed true"
Line 3 - $GetCertificateCommand = "security certificate show -common-name $CommonName -serial $SerialNumber -ca $CertificateAuthority -type $Type -protocol $Protocol -hash-function $HashFunction -self-signed true"
Line - 4 $GetCertificateResults = Invoke-NcSsh $GetCertificateCommand
Line - 5 $GetCertificateResults = $GetCertificateResults.ToString()