Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20625

Re: Powershell: New-Object -com not working

$
0
0

Try replacing:

 

$lvl = $res.notificationlevel

 

with:

 

[int]$lvl = $res.notificationlevel

 

Given you're output if it hit's the default statement from your switch, it doesn't return a number.

 

Output: ==============================================

Message.WinUpdates: Windows Updates status couldnt be determined

Statistic.WinUpdates:

 

Running with the updated line outputs a '0':

 

Message.WinUpdates: Windows Updates status couldnt be determined

Statistic.WinUpdates: 0

 

Update: As well, your last line return an exit code of $lvl, and if it isn't a value of 0, the SAM element will go into a down state and you will receive the "Get Output Failed" message.


Viewing all articles
Browse latest Browse all 20625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>