VMware Cloud Community
magalhpa
Contributor
Contributor
Jump to solution

PowerCLI and SCOM2007 - same snapin name -> get-task

Both PowerCLI 4.0U1 and Microsoft System Operations Manager 2007 Powershell snapins have a command with the same name, get-task. Is it possible to get a workaround so we can use the features from both snapins?

Any chance the PowerCLI command could be changed to something like Get-VITask? Thank You.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

As a workaround you can do

VMware.VimAutomation.Core\Get-Task

or

$PCLI = "VMware.VimAutomation.Core"
....
& "$PCLI\Get-Task"

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

As a workaround you can do

VMware.VimAutomation.Core\Get-Task

or

$PCLI = "VMware.VimAutomation.Core"
....
& "$PCLI\Get-Task"

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
LucD
Leadership
Leadership
Jump to solution

For this problem have a look at Richard's post Cmdlet name clashes.

And perhaps vote for the enhancement request Dimitri has raised.

____________

Blog: LucD notes

Twitter: lucd22


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

admin
Immortal
Immortal
Jump to solution

Hi there,

You can also use alias:

PS> New-Alias Get-VITask VMware.VimAutomation.Core\Get-Task

PS> Get-VITask

Vitali

PowerCLI team

0 Kudos
LucD
Leadership
Leadership
Jump to solution

An alias would indeed be another solution, but I have to agree with what Richard said about aliases.

"It would be possible to create separate aliases for the clashing cmdlets but the issue with that is portability and remembering to use the alias especially if its something that is used infrequently."

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos