Hi Team,
Here my conf :
- VMware PowerCLI 6.5 Release 1 build 4624819
- VMware vCenter Server Version 5.5.0
- ESX Version 5.5U3 (3029944)
I want to make a script with PowerCLI modifying the power policy for desktop pools into "Power Off" for all my pools.
But the command 'Get-Pool' doesn't work.
I did this so far :
Install Advanced Functions
- Go to the GitHub repository page at https://github.com/vmware/PowerCLI-Example-Scripts.
- Click the green Clone or download button and then click Download ZIP.Advanced Functions Download
- Extract the zip file and copy the advanced functions Hv.Helper folder to a modules directory.
- Check your PowerShell $env:PSModulePath variable to see which directories are in use:
- Unblock the advanced functions to allow them to be executed.
dir ‘C:\Program Files\WindowsPowerShell\Modules\VMware.HvHelper\’ | Unblock-File
I heard in the new versions of PowerCLI the command 'Get-Pool' doesn't exist anymore, is that true ?
Thanks in advance for your help.
Best regards,
M. JOSEPH
Is that a rule in your environment to forbid access to the video?
Your PowerCLI version has in fact no impact on this version of View.
With the older View version you are obliged to use the PSSnapin on the Connection Server.
The Horizon View module that comes with your PowerCLI version, does not support that version of View.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, thank you for this information.
Well, everyone is restricted in my company to read videos online.
A process is running, so I'll have access to the video next week if everything's going fine.
Then I'll try your solution.
Hi again,
Sorry it took long to have my rights for multimedia stuff.
I checked your video method 1A and I got an error with this command :
$shortcut.Save()
Impossible to register the shortcut "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\VMware\View PowerCLI.lnk".
At character Line:11 : 5
+ $shortcut.Save()
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException
I added permissions on this folder then ran again the script : Ok.
But the shortcut can't be executed. It seems there is no extension on this shortcut (cf.attachment).
I'll try method 1B waiting your answer.
Are you sure that is not a security measure in your environment, which doesn't allow you to create and run shortcuts?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hmm, yes maybe, I'll try some stuff to correct this.
Well, I succeed to run my powershell in version 2.0, so I'll try to connect to my View or vCenter adn I'll be back to you.
Step by step .
Can I do everything on my workstation or do I need to do something on my view or vCenter server ? (Because I don't have access to them, I only have access to the console)
For example, in my PS V2, I have this when I put this :
PS C:\windows\system32> Add-PSSnapin VMware.View.Broker
Add-PSSnapin : The Windows PowerShell snap-in "VMware.View.Broker" is not installed on this computer.
Au niveau de ligne : 1 Caractère : 13
+ Add-PSSnapin <<<< VMware.View.Broker
+ CategoryInfo : InvalidArgument: (VMware.View.Broker:String) [Add-PSSnapin], PSArgume
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
I'm checking on other threads as well.
No, you have to do this on the Connection Server.
The shortcut is only a solution to avoid an issue with PowerShell v3 or higher.
The PSSnapin that come with the old View version only run in PowerShell v2.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Well if I have to do this on the Connection Server, I can't do anything for the moment so.
I'm sorry for wasting your time but at least I learned some new stuff about PS .
I'll keep everything until I have my rights to the Connection Server.
Thank you so much for your help and it's amazing how fast you are.
Best Regards.