Hi Luc,
i am observing some issues uisnf content lib commands .
i am doing following to make commands available (and they are available)
Update-Module vmware.powercli
Import-Module vmware.vimautomation.core
however it does not work sometimes
New-ContentLibrary : The term 'New-ContentLibrary' 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 C:\Users\Administrator\Desktop\BPI.ps1:271 char:9
+ $conlib=New-ContentLibrary -Name "siteA con lib" -Datastore (get-data ...
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-ContentLibrary:String) [], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The default is 'All'
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What does the following show?
and also
Get-Module -Name VMware*
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
it happend when i am tryyig to create content lib .which is one of the part of the project script we have been discussing .
i think yu already have that link.
i have added import-module vmware.vimautomation.core in the script .but even that it is failing to get command
If you are doing this in HOL-2012-01-SDC - VMware vSphere Automation - PowerCLI, then, unfortunately, that lab is using PowerCLI 11.3.0.
While the Content Library cmdlets were introduced in PowerCLI 11.5.0.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i have update using
update-module vmware.powercli .
it has worked many times as daily iam testing the project script .
i have seen content lib being created .
That's strange, normally you have no Internet access in the HOL.
Can you confirm the update by doing
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i am loggin in back however can yu try running the script from below on lab.its not completer but
it will
check linked mode configuration
update powercli
install posh-ssh
create ftp server on local control center
and create contet lib
Ok, the Update-Module works for me (do it from a PS session that is started As Administrator).
Then creating and displaying Content Libraries works for me.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
it is working most of the times but today i got error which i posted .not sure what is the reason.
When you encounter it again, do the Get-Module command.
Perhaps even in your script after the Update-Module.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
ok.just thought of asking if iam running
update-module vmware.powercli
or
install-module posh-ssh
do i need to import respective module .as i had to run this to use them .
If you are on PS v3 or higher and if the module is installed in a directory listed in $env:PSModulePath, you don't need to do the Import-Module.
But, module autoloading is based on a file the PS engine creates.
It might be that this file is not updated after your Update-Module or Install-Module yet.
Or that the $PSModuleAutoLoadingPreference variable is not set.
Conclusion: the Import-Module is most probably not needed, but to be on the safe side it won't do any harm either
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
well iam doing it on lab which is 5.1 ps version .
and i think installing directly from powershell gallery uses $env:PSModulePath only as this is what we discussed long time back as the advantage of instaling latest versions of powercli directly from powershell gallery.(that was the magic part...)
however i will check $PSModuleAutoLoadingPreference.
Or that the $PSModuleAutoLoadingPreference variable is not set.
checking above .well i dont see this neither in variable: drive nor in env: drive
what should i set it to ??
The default is 'All'
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference