Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Weird get-command behavior

Reply
 
Old 11-21-2007   #1 (permalink)
Hal Rottenberg


 
 

Weird get-command behavior

What do you guys think of this?

C:\WINDOWS\system32\WindowsPowerShell\v1.0\System.Management.Automation.dll
85# get-command (Get-PSSnapin microsoft.powershell.core).ModuleName
Get-Command : The term
'C:\WINDOWS\system32\WindowsPowerShell\v1.0\System.Management.Autom
ation.dll' is not recognized as a cmdlet, function, operable program, or script
file. Veri
fy the term and try again.
At line:1 char:6
+ which <<<< (Get-PSSnapin microsoft.powershell.core).ModuleName

This fails on all included snapins but all 3rd-party ones work. Same vor V1 and
CTP.
--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)

My System SpecsSystem Spec
Old 11-21-2007   #2 (permalink)
Oisin Grehan


 
 

Re: Weird get-command behavior

On Nov 21, 2:27 pm, Hal Rottenberg <h...@xxxxxx> wrote:
Quote:

> What do you guys think of this?
>
> C:\WINDOWS\system32\WindowsPowerShell\v1.0\System.Management.Automation.dll
> 85# get-command (Get-PSSnapin microsoft.powershell.core).ModuleName
> Get-Command : The term
> 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\System.Management.Autom
> ation.dll' is not recognized as a cmdlet, function, operable program, or script
> file. Veri
> fy the term and try again.
> At line:1 char:6
> + which <<<< (Get-PSSnapin microsoft.powershell.core).ModuleName
>
> This fails on all included snapins but all 3rd-party ones work. Same vor V1 and
> CTP.
> --
>
> Hal Rottenberg
> Blog:http://halr9000.com
> Webmaster, Psi (http://psi-im.org)
> Co-host, PowerScripting Podcast (http://powerscripting.net)
Simply put, this is because the ModuleName no longer exists at this
path. The posh installer probably installutil'd it at this location
before adding it to the gac, then removing it.

PS > test-path (Get-PSSnapin microsoft.powershell.core).ModuleName
False

- Oisin / x0n
My System SpecsSystem Spec
Old 11-21-2007   #3 (permalink)
Hal Rottenberg


 
 

Re: Weird get-command behavior

Oisin Grehan wrote:
Quote:

> Simply put, this is because the ModuleName no longer exists at this
> path. The posh installer probably installutil'd it at this location
> before adding it to the gac, then removing it.
>
> PS > test-path (Get-PSSnapin microsoft.powershell.core).ModuleName
> False
Ok, that makes sense, but I don't know enough about GAC to understand why this
is. Are the other snapins leaving cruft around on my hard drive that they could
safely delete?

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
weird newsgroup behavior Live Mail
Weird Virtual PC behavior Vista General
Weird website behavior Network & Sharing
Weird Forwarding Behavior Live Mail
Weird behavior when printing Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46