小编new*_*mer的帖子

你如何在powershell中解密securestring

$Variable = Read-Host "Enter thing" -AsSecureString
Run Code Online (Sandbox Code Playgroud)

将提示您输入并将其保存为变量的安全字符串。如何解密安全字符串变量?

PS C:\Users\Todd> $Variable
System.Security.SecureString
Run Code Online (Sandbox Code Playgroud)

powershell

3
推荐指数
2
解决办法
1873
查看次数

有其他开关吗?

switch在 PowerShell 中就像一个不太复杂的if elseif语句,但else不起作用。还有什么我可以做的吗?

switch ("test") {
  "1" {"2"}
  "2" {"1"}
} else {"other"}
Run Code Online (Sandbox Code Playgroud)

给出错误

else : The term 'else' 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:4 char:3
+ } else {"other"}
+   ~~~~
    + CategoryInfo          : ObjectNotFound: (else:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : …
Run Code Online (Sandbox Code Playgroud)

powershell

-1
推荐指数
1
解决办法
51
查看次数

标签 统计

powershell ×2