且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果字符串在PowerShell中以开头

更新时间:2023-11-06 19:08:28

$Group是一个对象,但是实际上您需要检查$Group.samaccountname.StartsWith("string")是否.

$Group is an object, but you will actually need to check if $Group.samaccountname.StartsWith("string").

$Group.StartsWith("S_G_")更改为$Group.samaccountname.StartsWith("S_G_").