Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Set StrictMode changes script behavior

$
0
0

The following script fails when I use the Set-StrictMode statement. Without the statement it works fine.

Set-StrictMode -Version Latest

Param(

    [string]$ComputerName = 'localhost'

    )

Get-CimInstance -ClassName win32_OperatingSystem -ComputerName $ComputerName


Viewing all articles
Browse latest Browse all 6937

Trending Articles