# Pending reboots

**URL:** <https://forums.powershell.org/t/pending-reboots/9951>\
**Category:** PowerShell Help\
**Created:** [January 8, 2018, 10:37am UTC](https://forums.powershell.org/t/pending-reboots/9951 "2018-01-08T10:37:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrodriguez](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@chrodriguez](https://forums.powershell.org/u/chrodriguez)\
**Post date:** [January 8, 2018, 10:37am UTC](https://forums.powershell.org/t/pending-reboots/9951/1 "2018-01-08T10:37:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jacorbello](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jacorbello](https://forums.powershell.org/u/jacorbello)\
**Post date:** [January 8, 2018, 10:53am UTC](https://forums.powershell.org/t/pending-reboots/9951/2 "2018-01-08T10:53:27Z")

</div>

Get-PendingReboot is not a cmdlet. A quick search shows it’s a script (see here: [https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542](https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542))  
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.

---

<div class="post-metadata">

**Author:** ![will-anderson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/will-anderson/32/234_2.png) [@will-anderson](https://forums.powershell.org/u/will-anderson)\
**Post date:** [January 8, 2018, 10:53am UTC](https://forums.powershell.org/t/pending-reboots/9951/3 "2018-01-08T10:53:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrodriguez](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@chrodriguez](https://forums.powershell.org/u/chrodriguez)\
**Post date:** [January 8, 2018, 11:07am UTC](https://forums.powershell.org/t/pending-reboots/9951/4 "2018-01-08T11:07:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrodriguez](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@chrodriguez](https://forums.powershell.org/u/chrodriguez)\
**Post date:** [January 8, 2018, 11:09am UTC](https://forums.powershell.org/t/pending-reboots/9951/5 "2018-01-08T11:09:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jacorbello](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jacorbello](https://forums.powershell.org/u/jacorbello)\
**Post date:** [January 8, 2018, 11:10am UTC](https://forums.powershell.org/t/pending-reboots/9951/6 "2018-01-08T11:10:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jacorbello](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jacorbello](https://forums.powershell.org/u/jacorbello)\
**Post date:** [January 8, 2018, 11:17am UTC](https://forums.powershell.org/t/pending-reboots/9951/7 "2018-01-08T11:17:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrodriguez](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@chrodriguez](https://forums.powershell.org/u/chrodriguez)\
**Post date:** [January 8, 2018, 11:22am UTC](https://forums.powershell.org/t/pending-reboots/9951/8 "2018-01-08T11:22:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:36pm UTC](https://forums.powershell.org/t/pending-reboots/9951/9 "2024-05-16T20:36:53Z")

</div>

Closed on May 16, 2024, 8:36pm UTC


