de2rfg
Enthusiast
Enthusiast

Scan-Inventory -> The term 'Test-Compliance' is not recognized as the name of a cmdlet

Hi,

not sure what is going wrong at the moment, but I've installed VUM powercli package and I did some testing yesterday. Today Scan-Inentory and other VUM powercli commands fail with error "Test-Compliance' is not recognized as the name of a cmdlet..."

But as far as I can see the VUM powercli snapin/module is installed and loaded.

Scan-Inventory -Entity xxxx

Scan-Inventory : The term 'Test-Compliance' 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.

At line:1 char:1

+ Scan-Inventory -Entity xxxxx

+ ~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Test-Compliance:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

Add-PSSnapin VMware.VumAutomation

Add-PSSnapin : Cannot add Windows PowerShell snap-in VMware.VumAutomation because it is already added. Verify the name of the snap-in, and then try again.

At line:1 char:1

+ Add-PSSnapin VMware.VumAutomation

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (VMware.VumAutomation:String) [Add-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

> Import-Module VMware.VumAutomation -Verbose                                                                                                                                                              

VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.psd1'.

VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\IntegritySoapService40.dll'.

VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\IntegritySoapService40.XmlSerializers.dll'.

VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.Client40.dll'.

VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\VMware.VumAutomation.dll'.

VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\VMware.VumAutomation.Types.dll'.

VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.Format.ps1xml'.

VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\Initialize-VMware_VumAutomation.ps1'.

VERBOSE: Dot-sourcing the script file 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\Initialize-VMware_VumAutomation.ps1'.

VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.ps1'.

VERBOSE: Dot-sourcing the script file 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.ps1'.

VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.dll'.

VERBOSE: Exporting cmdlet 'Attach-Baseline'.

VERBOSE: Exporting cmdlet 'Get-Baseline'.

VERBOSE: Exporting cmdlet 'Detach-Baseline'.

VERBOSE: Exporting cmdlet 'Download-Patch'.

VERBOSE: Exporting cmdlet 'Get-Compliance'.

VERBOSE: Exporting cmdlet 'Get-Patch'.

VERBOSE: Exporting cmdlet 'Get-PatchBaseline'.

VERBOSE: Exporting cmdlet 'New-PatchBaseline'.

VERBOSE: Exporting cmdlet 'Remove-Baseline'.

VERBOSE: Exporting cmdlet 'Set-PatchBaseline'.

VERBOSE: Exporting cmdlet 'Remediate-Inventory'.

VERBOSE: Exporting cmdlet 'Scan-Inventory'.

VERBOSE: Exporting cmdlet 'Stage-Patch'.

WARNING: The names of some imported commands from the module 'VMware.VumAutomation' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.

VERBOSE: The 'Attach-Baseline' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. The suggested alternative verbs are "Add, Debug".

VERBOSE: Importing cmdlet 'Attach-Baseline'.

VERBOSE: The 'Detach-Baseline' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. The suggested alternative verbs are "Dismount, Remove".

VERBOSE: Importing cmdlet 'Detach-Baseline'.

VERBOSE: The 'Download-Patch' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.

VERBOSE: Importing cmdlet 'Download-Patch'.

VERBOSE: Importing cmdlet 'Get-Baseline'.

VERBOSE: Importing cmdlet 'Get-Compliance'.

VERBOSE: Importing cmdlet 'Get-Patch'.

VERBOSE: Importing cmdlet 'Get-PatchBaseline'.

VERBOSE: Importing cmdlet 'New-PatchBaseline'.

VERBOSE: The 'Remediate-Inventory' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.

VERBOSE: Importing cmdlet 'Remediate-Inventory'.

VERBOSE: Importing cmdlet 'Remove-Baseline'.

VERBOSE: The 'Scan-Inventory' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.

VERBOSE: Importing cmdlet 'Scan-Inventory'.

VERBOSE: Importing cmdlet 'Set-PatchBaseline'.

VERBOSE: The 'Stage-Patch' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.

VERBOSE: Importing cmdlet 'Stage-Patch'.

0 Kudos
7 Replies
LucD
Leadership
Leadership

Which version of the module is that ?

Stupid suggestion, did you already try stopping/starting your PowerShell session?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
de2rfg
Enthusiast
Enthusiast

I've already rebooted the host, no difference.

0 Kudos
LucD
Leadership
Leadership

And which PowerCLI version are you using?

Can you do a Get-PowerCLIVersion


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
de2rfg
Enthusiast
Enthusiast

I've updated to 6.3 after the problems began, before it was some other 6.x version. Also latest VUM powercli package.

0 Kudos
LucD
Leadership
Leadership

Does it find the cmdlet when you use the PowerCLI prompt (started via the PowerCLI shortcut) ?

If you're on 6.3, there is only the module, no PSSnapin afaik.

And the module seems to load ok judging from the verbose output.

Can you do 'Get-Command -Module VMware.VumAutomation' after you loaded the Update Manager module?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
de2rfg
Enthusiast
Enthusiast

Running in PowerShell command window is working fine, it seems it only happens in PowerGUI. There seems to be a difference in the get-command output depending on where I run it and Test-Compliance is missing.

PowerShell:

PS C:\Users\de2rfg> Get-Command -Module VMware.VumAutomation

CommandType     Name                                               ModuleName

-----------     ----                                               ----------

Alias           Attach-Baseline                                    VMware.VumAutomation

Alias           Detach-Baseline                                    VMware.VumAutomation

Alias           Download-Patch                                     VMware.VumAutomation

Alias           Remediate-Inventory                                VMware.VumAutomation

Alias           Scan-Inventory                                     VMware.VumAutomation

Alias           Stage-Patch                                        VMware.VumAutomation

Cmdlet          Add-EntityBaseline                                 VMware.VumAutomation

Cmdlet          Copy-Patch                                         VMware.VumAutomation

Cmdlet          Get-Baseline                                       VMware.VumAutomation

Cmdlet          Get-Compliance                                     VMware.VumAutomation

Cmdlet          Get-Patch                                          VMware.VumAutomation

Cmdlet          Get-PatchBaseline                                  VMware.VumAutomation

Cmdlet          New-PatchBaseline                                  VMware.VumAutomation

Cmdlet          Remove-Baseline                                    VMware.VumAutomation

Cmdlet          Remove-EntityBaseline                              VMware.VumAutomation

Cmdlet          Set-PatchBaseline                                  VMware.VumAutomation

Cmdlet          Sync-Patch                                         VMware.VumAutomation

Cmdlet          Test-Compliance                                    VMware.VumAutomation

Cmdlet          Update-Entity                                      VMware.VumAutomation



PowerGUI (just started before I entered the command):

PS C:\Users\de2rfg\Documents> Get-Command -Module VMware.VumAutomation -Verbose

CommandType     Name                                               ModuleName                                                                                     

-----------     ----                                               ----------                                                                                     

Alias           Attach-Baseline                                    VMware.VumAutomation                                                                           

Alias           Detach-Baseline                                    VMware.VumAutomation                                                                           

Alias           Download-Patch                                     VMware.VumAutomation                                                                           

Alias           Remediate-Inventory                                VMware.VumAutomation                                                                           

Alias           Scan-Inventory                                     VMware.VumAutomation                                                                           

Alias           Stage-Patch                                        VMware.VumAutomation                                                                           

Cmdlet          Attach-Baseline                                    VMware.VumAutomation                                                                           

Cmdlet          Detach-Baseline                                    VMware.VumAutomation                                                                           

Cmdlet          Download-Patch                                     VMware.VumAutomation                                                                           

Cmdlet          Get-Baseline                                       VMware.VumAutomation                                                                           

Cmdlet          Get-Compliance                                     VMware.VumAutomation                                                                           

Cmdlet          Get-Patch                                          VMware.VumAutomation                                                                           

Cmdlet          Get-PatchBaseline                                  VMware.VumAutomation                                                                           

Cmdlet          New-PatchBaseline                                  VMware.VumAutomation                                                                           

Cmdlet          Remediate-Inventory                                VMware.VumAutomation                                                                           

Cmdlet          Remove-Baseline                                    VMware.VumAutomation                                                                           

Cmdlet          Scan-Inventory                                     VMware.VumAutomation                                                                           

Cmdlet          Set-PatchBaseline                                  VMware.VumAutomation                                                                           

Cmdlet          Stage-Patch                                        VMware.VumAutomation 

                                                                         

0 Kudos
LucD
Leadership
Leadership

That looks like a PowerGUI issue then.
I'm not sure if there still is active support now that PowerGUI is under the Dell umbrella.
You could check if they still have an active user forum.

To be honest I have never been a big PowerGUI fan, they do/did stuff under the cover which I didn't like..

Time to look at alternatives I guess.
There are several alternatives available: the PS ISE, Visual Studio Code, PowerShell Plus...


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos