# PowerShell Repair?

**URL:** <https://forums.powershell.org/t/powershell-repair/2581>\
**Category:** PowerShell Help\
**Created:** [May 18, 2014, 2:33pm UTC](https://forums.powershell.org/t/powershell-repair/2581 "2014-05-18T14:33:49Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [May 21, 2014, 3:03pm UTC](https://forums.powershell.org/t/powershell-repair/2581/21 "2014-05-21T15:03:25Z")

</div>

Bummer, I was hoping it would be one of those snapins, based on earlier hints of SQL causing the same problem for other people.

Next, I’d try the modules. A quick way of seeing if this will be helpful is to rename your My Documents\WindowsPowerShell\Modules folder, launch PowerShell, and try Get-Command again. If it works, then you can try creating a new Modules folder and moving them in a few at a time. Hopefully, you’ll be able to identify one or more modules that are triggering this problem with Get-Command.

---

<div class="post-metadata">

**Author:** ![john-drake](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@john-drake](https://forums.powershell.org/u/john-drake)\
**Post date:** [May 21, 2014, 4:07pm UTC](https://forums.powershell.org/t/powershell-repair/2581/22 "2014-05-21T16:07:41Z")

</div>

Brilliant, Dave, renaming that modules directory (and I created a fresh empty one) has fixed both get-command and get-dscresource (which was where I started).

I’ve put in a Connect suggestion (ID 878376) for PowerShell Repair as it seems to me it would be good if there was a simple way to say “take me back to a clean working default installation of PowerShell (and please discard profiles, snap-ins, modules, etc)”.

Many thanks for all the help.

PS Env:&gt; get-command

CommandType Name ModuleName

* * *

Function A:  
Function B:  
Function C:  
Function cd…  
Function cd  
…

PS Env:&gt; get-dscresource

ImplementedAs Name Module Properties

* * *

Binary File {DestinationPath, Attributes, Checksum, Con…  
PowerShell Archive PSDesiredStateConfiguration {Destination, Path, Checksum, DependsOn…}  
PowerShell Environment PSDesiredStateConfiguration {Name, DependsOn, Ensure, Path…}  
PowerShell Group PSDesiredStateConfiguration {GroupName, Credential, DependsOn, Descript…  
Binary Log PSDesiredStateConfiguration {Message, DependsOn}  
PowerShell Package PSDesiredStateConfiguration {Name, Path, ProductId, Arguments…}  
PowerShell Registry PSDesiredStateConfiguration {Key, ValueName, DependsOn, Ensure…}  
PowerShell Script PSDesiredStateConfiguration {GetScript, SetScript, TestScript, Credenti…  
PowerShell Service PSDesiredStateConfiguration {Name, BuiltInAccount, Credential, DependsO…  
PowerShell User PSDesiredStateConfiguration {UserName, DependsOn, Description, Disabled…  
PowerShell WindowsFeature PSDesiredStateConfiguration {Name, Credential, DependsOn, Ensure…}  
PowerShell WindowsProcess PSDesiredStateConfiguration {Arguments, Path, Credential, DependsOn…}  
PowerShell xADDomain xActiveDirectory {DomainAdministratorCredential, DomainName,…  
…

---

<div class="post-metadata">

**Author:** ![ps\_gregg](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@ps\_gregg](https://forums.powershell.org/u/ps_gregg)\
**Post date:** [December 27, 2014, 1:28am UTC](https://forums.powershell.org/t/powershell-repair/2581/23 "2014-12-27T01:28:45Z")

</div>

I just discovered that I had the same problem with Get-Command. I didn’t realize I had the issue because I rarely run Get-Command without parameters. With the help of this article I tracked it down to the Module “RDS-Manager”. Once I removed the module from my modules directory(C:\Program Files\WindowsPowerShell\Modules), Get-Command started working again.

---

<div class="post-metadata">

**Author:** ![peaps](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@peaps](https://forums.powershell.org/u/peaps)\
**Post date:** [January 9, 2017, 10:29am UTC](https://forums.powershell.org/t/powershell-repair/2581/24 "2017-01-09T10:29:13Z")

</div>

I had the same problem myself. It was caused by setting StrictMode inside of a module. Once I removed the line, I no longer received the error which incidentally was triggered inside of the PSDesiredStateConfiguration module.

---

<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:40pm UTC](https://forums.powershell.org/t/powershell-repair/2581/25 "2024-05-16T20:40:28Z")

</div>



[Previous page](https://forums.powershell.org/t/powershell-repair/2581.md?page=1)
