我有一个脚本,我试图删除链接的硬编码和通配符。
$Skip = "http://test.com","http://server/Main/*"
$Site = Get-SPSite
foreach($Skip - notcontains $Site)
{
//Do Something
}如何确保它将http://server/Main/*验证为通配符,如果$Site是http://server/Main/Test.something或http://test.com,则不进行处理
谢谢
发布于 2015-05-20 19:36:52
使用-like操作符:
$Skip = "http://test.com","http://server/Main/*"
$Site = Get-PSSite
$Process = $True
$Skip | Foreach-Object {
if($Site.Url -like $_){
$Process = $False
}
}
if($Process){
# Do Something
}https://stackoverflow.com/questions/30357814
复制相似问题