Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: If statement with -and Never worked

$
0
0

You can trim the $OS string or only match what you're looking for:

Trim example:

If (($OSArch -eq "64-Bit") -and ($OS.Trim() -eq "Microsoft Windows 7 Enterprise"))

Match example:

If (($OSArch -eq "64-Bit") -and ($OS -match "Microsoft Windows 7 Enterprise"))

Viewing all articles
Browse latest Browse all 13067

Trending Articles