我已经找到了参考文献,但仅找到“注意:出于安全原因,我们应该将密码存储为安全字符串,通过在启动PowerShell之前将其声明为变量。”谁能提供完成这项工作所需的步骤?
最好的答案vshuguet
\n\nSorry for the delay, I was travelling.
\n
\nI've put together a quick GitHub Gist with 3 files you can use to showcase the 3 steps you'd need to achieve your goal: https:\/\/gist.github.com\/shuguet\/6cb4577414357c25dbeb3d018a4b7373<\/a>
\n
\nStep 1: the \"create_key.ps1\" file in there is just used to create the encryption key.
\nStep 2: the \"encrypt_password.ps1\" file is used for you to encrypt you password and store that in a file.
\nThose 2 steps you'll most likely do once, and never again until you have to change the password.
\n
\nStep 3: In file\"get_ntnx_vms_with_crypted_passwd.ps1\" is an exemple of using this to connect to a Nutanix Cluster and get the list of VMs names.
\n
\nYou can re-use that with whatever you want to do using the Nutanix Cmdlets.","className":"post__content__best_answer"}">