Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: PowerShell Script Error

    To get rid of trailing or leading spaces try this:

    $a = $a.Trim()

    Or in this case:

    $server = $server.Trim()

  • RE: PowerShell Script Error

    Powershell Get-WmiObject : Invalid namespace

    Try this:

    $namespace = "root\CIMV2"

    Get-WmiObject -class Win32_Service -computername $computer -namespace $namespace

    Also; $servers=get-content "c:\servers.txt" <---- Make sure there are no leading or trailing spaces or tabs in...

Viewing 2 posts - 1 through 2 (of 2 total)