Hello,
I am looking for a script that can generate the Certificate expiry date of a vCenter(s).
I got this link: (Get-STSCerts.ps1) https://code.vmware.com/samples?id=7336#comments
But I was able to run the commands in the instruction Point 1 and 2. But getting the below error for point 3. Any suggestion? Or any other script that can use for ?
Get-STSCerts : The term 'Get-STSCerts' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
The problem is the quotes you used when you were dot-sourcing the .ps1 file.
That should be (without the quotes)
. .\Get-STSCerts.ps1
With the quotes, you are just showing a string on the console.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It looks as if you didn't do step 1 or 2 correctly.
Did you notice the 2 dots with a space in between in step 2?
That is called dot-sourcing and that is how you make sure your session "knows" that function.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello @LucD
This is what I have run:
cd 'C:\Scripts\vCenter Certificate'
". ./Get-STSCerts.ps1"
Get-STSCerts -vcenters <vCenterName> -user 'xxxx.xxx.com' -password 'xxxxxx'
You can check if you did that correctly by running
Get-Command -Name Get-STSCerts
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The problem is the quotes you used when you were dot-sourcing the .ps1 file.
That should be (without the quotes)
. .\Get-STSCerts.ps1
With the quotes, you are just showing a string on the console.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello,
Thank you @LucD ,
I was still getting some other error. But I got it fixed by unblocking it ( ' PS C:\> Unblock-File -Path C:\Downloads\script1.ps1') and then ran as you said. Thank you