ricky73's Posts

@ I meant from an editor window with the F5 key, not from the console command line in the ISE. Yes, this occurs in editor windows too, pressing  F5 key. Everything I write inside file, It's... See more...
@ I meant from an editor window with the F5 key, not from the console command line in the ISE. Yes, this occurs in editor windows too, pressing  F5 key. Everything I write inside file, It's has the same result. If I open PowerShell and I type script name (test.ps1) which has a simple connectin to server (connect-viserver  -server ...) got the same error. Does this for example also happen when you place a single cmdlet (for example Get-Process) in the Editor, Yes, I tried. I got the same result. I have no set variable as $CONSOLEFILENAME
I tried now. When I run script inside PowerShell ISE, a new window is opened where I have the same output: C:\Users\administrator.... >C:\Windows\System32\WindowsPowerShell\v1.0\powershell.... See more...
I tried now. When I run script inside PowerShell ISE, a new window is opened where I have the same output: C:\Users\administrator.... >C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\" $true" . : The term 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1' 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:3 + . "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scri ... +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (C:\Program File...Environment.ps1:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException This message appears for every script I run.
I tried 2 test. 1st test. I opened PowerShell console, I run script .ps1 which you described. Here is output: Get-Item : Cannot find path 'HKCR:\.ps1\OpenWithProgids' because it does not ... See more...
I tried 2 test. 1st test. I opened PowerShell console, I run script .ps1 which you described. Here is output: Get-Item : Cannot find path 'HKCR:\.ps1\OpenWithProgids' because it does not exist. At C:\Users\administrator.AUSL6\Desktop\test cruscotto auto di battaglia\prova.ps1:3 char:1 + Get-Item "HKCR:\$($assoc.split('=')[0])\OpenWithProgids" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (HKCR:\.ps1\OpenWithProgids:String) [Get-Item], ItemNotFoundException     + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand     Hive: HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open Name                           Property ----                           -------- Command                        (default) : "C:\Windows\System32\notepad.exe" "%1" 2nd test. I Open by, Windows Explorer, new windows and I click on script ps1 which you described. I got : . : The term 'C:\Program Files (x86)\VMware\Infrastructure\vSpherePowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1' 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:3 + . "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scri ... +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (C:\Program File...Environment.ps1:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException
.ps1 is file which I created by notepad in the Windows Explorer. I verified that .ps1 is just associated to PowerShell
I migrated from PowerCLI 6.3 to latest (10.11) in Windows 2012. I create test.ps script but when I run it I got: C:\Windows\System32\WindowsPowerShell\v1.0\powersell.exe -noe -c ". \"C:\Prog... See more...
I migrated from PowerCLI 6.3 to latest (10.11) in Windows 2012. I create test.ps script but when I run it I got: C:\Windows\System32\WindowsPowerShell\v1.0\powersell.exe -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\" $true". : The term 'C:\Program Files (x86)\VMware\Infrastructure\vSpherePowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1' 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:3 + . "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scri ...                                          As if There was link to Initialize-PowerCLIEnvironmet.ps1 file but I'm not able to understand where is it? This happens only if I click on script because if I open manually powershell by Windows link and I run command there is no problem, but I lost automatically mechanism! Suggestions please?
Thanks, your answer solved my problem.
I installed 10.11 PowerCLI according to Vmware recommendation. I created link to desktop as suggested by run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noe -c "Import-Module VM... See more...
I installed 10.11 PowerCLI according to Vmware recommendation. I created link to desktop as suggested by run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noe -c "Import-Module VMware.PowerCLI" So, backing to initial question If I want to schedule task (e.g. I'll create myscript.ps which create report), can I put the previous command into myscript.ps with the other commands?
I read about change log and next week I will update PowerCLI to latest version. I accepted suggestions to keep 6.x in previous thread but your word have elucidated how and what I have to do. In... See more...
I read about change log and next week I will update PowerCLI to latest version. I accepted suggestions to keep 6.x in previous thread but your word have elucidated how and what I have to do. In light of what you've pointed, It's no more necessary to run this stament for my script? That is, there is not the Scripts\Initialize-PowerCLIEnvironment.ps1. C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1
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 n... See more...
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.
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... See more...
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.
LucD​ look at the following thread PowerCLI on vCenter to see if I explained better what I wanted to say.
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 beca... See more...
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.
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 fea... See more...
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.
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 t... See more...
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 ?
so what version do you suggest me for vcenter 6.0.0 ?
6.3 release 1 because vcenter is 6.0.0 so I'd like to keep version not too updated
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 th... See more...
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?
Ok, but what advantage to install latest version if I have 6.0.0 vCenter? Perhaps I'll get new functions/features which I will m not able to use them because my vCenter is not updated? I thought... See more...
Ok, but what advantage to install latest version if I have 6.0.0 vCenter? Perhaps I'll get new functions/features which I will m not able to use them because my vCenter is not updated? I thought to install 6.3 or 6.0.0 latest version, what do you think?
What version can I install with vCenter 6.0.0 ?
It's recommended to install Power CLI inside vCenter server (6.0.0 - 3634793) or it's better to exclude it and install Power CLI into another server?