I read some doc about how to run my PowerCLI script to get my reports.
I understood It's necessary to initialize PowerShell environment to load required components and if you want to load all these ones, you have to run the script Initialize-PowerCLIEnvironment.ps1. It's right?
If I open the link, which VMware Power CLI created during installation, it shows:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1
How Can I run my script (test.ps) by the previous line loading all components?
What do you suggest me please?
That is correct, there is no more need to run any kind of init script to load the PowerCLI modules.
They are loaded through the module autoload features.
Since the installation process has changed since PowerCLI is available through the PowerShell Gallery, I suggest to first read
Welcome PowerCLI to the PowerShell Gallery – Install Process Updates
and
Updating PowerCLI through the PowerShell Gallery
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Which PowerCLI version are you using?
In more recent versions you don't have to run this init script anymore, all loading is done through module auto loading (since PowerCLI 6.5.1, which is NOT 6.5 R1).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
6.3 release 1 because vcenter is 6.0.0 so I'd like to keep version not too updated
Not too sure why you need to stick on the older 6.3, that is no prereq for vCenter 6.
You're missing out on some major improvements.
One of the important ones is the move to all modules, no more PSSnapin.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
so what version do you suggest me for vcenter 6.0.0 ?
I would go for the latest 10.1.1, you can always return to the one you are using currently.
See Welcome PowerCLI to the PowerShell Gallery – Install Process Updates for instructions on how to do the update.
But first check what PowerShell version you are currently using.
What is in $PSVersionTable.
Is that showing PowerShell 5.1? Or an earlier version?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It's the latest, that is 5.1 which I updated just before PowerCli installation.
I believed latest PowerCli 10.x uses enhanced features which are not available for my 6.0..0 vCenter so I prefer to keep just steps before 10.x
What do you think ? 6.5 or 10.x with vCenter 6.0.0 ?
I'm afraid you interpret that incorrectly, it's not because PowerCLI 10.1.1 supports new features in 6.5 or 6.7, that you can't use that version with vSphere 6.
Those new features just will not work in 6.0.
It's not that the internal workings of PowerCLI cmdlet are different, you just have additional ones, or new parameters on existing cmdlets.
Btw, if you know that you are in vSphere 6, you shouldn't be calling newer features.
And that is also why there is a compatibility matrix!
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD
if you know that you are in vSphere 6, you shouldn't be calling newer features.
That's right! infact this is main reason to not install last version, so I'm sure I'll get almost all features for my vCenter version.
You don't seem to understand that this cumulative.
There is no reason to stay on an older PowerCLI version.
If the compatibility matrix shows that a version is compatible with your vSphere version , you will be able to use all features of that version.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'll try to explain in different way.
If I installed vCenter PowerCLI 10.x and for example It uses function "K1" which is characteristic for only vCenter 6.5/6.7 , I will not able to use it because it's not provided inside vCenter 6.0.
If I use manual of PowerCLI 10.x, I can make mistake and confuse myself because I don't know what is command for my vCenter; if I have to create new script and I have to verify what function of Powercli are available for my older vCenter.
I understood that latest PowerCLI to use all features of previous version.
I give up!
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That remark is a bit misplaced imho.
Your problem is with Jenkins, and you insist on using an older PowerCLI version, with all the complications that version brings.
I pointed to a solution in your thread, did you even look at it, or even better, try it?
Btw, the 'power' in the name comes from the link with PowerShell.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD
look at the following thread PowerCLI on vCenter
to see if I explained better what I wanted to say.
No, I still see the same misconception about using an up to date PowerCLI version.
Btw, a reply that agrees to install PowerCLI on a vCenter would make me very wary about everything else that person says.
A newer version not only introduces new features, but also improvements and bug fixes.
Just have a look at the Release Notes.
But it's your choice, and like I said I give up on this thread.
I don't even have 6.3 anymore.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'd like to take a second to echo what LucD has been saying.
The official VMware statement is to always be on the latest version of PowerCLI.
This is said for many reasons, most of which were outlined in the form of a blog post from the other thread you linked to: Which Version of PowerCLI is Right For Me? - VMware PowerCLI Blog - VMware Blogs
Basically:
Ok, according to all suggestions, I'll migrate to latest version 10.x
But what powerCLI reference guide document I should have to use? I think for 10.x.
Let's suppose I need new function for my script and I found it in 10.x manual, how I detect if this feature is implemented or no in vCenter 6.0? Is there matrix which list for every function in what vCenter is available ?
I'm not saying about exist scripts because I know is guaranteed backward compatibility.
The PowerCLI information is available in 2 formats.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm sorry but we are speaking 2 different languages, I'm not saying where I can find documentation about PowerCli 10.x
My question is another one, I'll try again to explain:
Let's suppose I need new function for my script and I found it in 10.x manual, how I detect if this feature is implemented or no in vCenter 6.0? Is there matrix which list for every function in what vCenter is available ?
PowerCLI 10.x could be provide function "A" for only vCenter 6.7 so if I used (unawares) this A function in vCenter 6.0.0, I'll get error or no result, right? I'd like to avoid it.
How can I verify functions which I'll use in PowerCLI 10.x, are good for vCenter 6.0 ? There will be dedicated enhanced functions for only 6.5/6.7 vCenter, right?
I'm saying about new script which I'll create in future, not existing script which are compatible to new PowerCLI version.