Author Posts

January 8, 2018 at 4:07 pm

I'm trying to see what servers I have that are in the status of "Pending reboot", I run the following:
$Servers = Get-Content C:\ServerList.txt
Get-PendingReboot -ComputerName $Servers | Export-CSV C:\Util\PendingRebootReportServers.csv -NoTypeInformation

but returns this error: Get-PendingReboot : The term 'Get-PendingReboot' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.

January 8, 2018 at 4:23 pm

Get-PendingReboot is not a cmdlet. A quick search shows it's a script (see here:
So what you'll need to do is something like this:

c:\path\to\Get-PendingReboot.ps1 -ComputerName $Servers | Export-CSV C:\Util\PendingRebootReportServers.csv -NoTypeInformation

You have tell PowerShell where the script is, so it can run it.

January 8, 2018 at 4:23 pm

Get-PendingReboot is not a standard cmdlet. Do you have a module installed on your machine with this cmdlet in it?

January 8, 2018 at 4:37 pm

Set-Location : A parameter cannot be found that matches parameter name 'ComputerName'.

January 8, 2018 at 4:39 pm

No I don't I though that Import-Module ActiveDirectory would work, do you happen to have one that I should have installed?

January 8, 2018 at 4:40 pm

Your original command didn't show you using Set-Location. What exactly was done that caused that error to pop up?

January 8, 2018 at 4:47 pm

Let's take a step back. Where did you learn about Get-PendingReboot?

January 8, 2018 at 4:52 pm

disregard I got it to work by loading this "script" as a "function" by "dot sourcing" the .ps1 file.