You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appeared in an offline, highside env. All dependencies already present (inspec, powershell core).
I first tried to import the library.
Import-Module vmware.powercli
...
Exception: The VMware.ImageBuilder module is not currently supported on the Core edition of PowerShell.
After that did not work, I just copied over the structure and placed the VMware.PowerCLI and all its dependencies into /root/.local/share/powershell/Modules/
After I did that I was able to run PowerCLI commands. Connect to a server etc.
However I get the following error from InSpec
Unable to determine PowerCLI Module version, is it installed?
The file in question: /opt/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb
The issue is how the logic is handled to identify the PowerCLI version:
This will work regardless of if it was installed or imported, or the files placed in the module directories.
However changing this then makes the actual stdout to contain data that breaks the logic currently in place to capture the return code sent from stdin.
As you can see from the above output, "ion)" remains in the stdout which is actually from the initial command containing the last 5 characters of the word "Version"
This could be solved by changing the logic used to parse out the return code.
Steps to Reproduce:
1. Offline Environment with no access to a PowerShell Repository (PowerShell Core)
2. Bring over the PowerCLI Modules and place into /root/.local/share/powershell/Modules/
3. Run a Connect-VIServer or whatever command to validate it is installed
4. Run ESXi InSpec Profile from https://github.com/vmware/dod-compliance-and-automation
Expected Result:
For this to function without issue as it does when modules are installed or imported.
Actual Result:
Fails
The text was updated successfully, but these errors were encountered:
Version:
4.52.9
Environment:
PowerCLI Version: 12.5.0.19195797
OS: RHEL 8.4
PowerShell Core Version: 7.2.1-1.rh
Scenario:
This appeared in an offline, highside env. All dependencies already present (inspec, powershell core).
I first tried to import the library.
After that did not work, I just copied over the structure and placed the VMware.PowerCLI and all its dependencies into /root/.local/share/powershell/Modules/
After I did that I was able to run PowerCLI commands. Connect to a server etc.
However I get the following error from InSpec
The file in question: /opt/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb
The issue is how the logic is handled to identify the PowerCLI version:
If this is switched to:
This will work regardless of if it was installed or imported, or the files placed in the module directories.
However changing this then makes the actual stdout to contain data that breaks the logic currently in place to capture the return code sent from stdin.
As you can see from the above output, "ion)" remains in the stdout which is actually from the initial command containing the last 5 characters of the word "Version"
This could be solved by changing the logic used to parse out the return code.
Steps to Reproduce:
1. Offline Environment with no access to a PowerShell Repository (PowerShell Core) 2. Bring over the PowerCLI Modules and place into /root/.local/share/powershell/Modules/ 3. Run a Connect-VIServer or whatever command to validate it is installed 4. Run ESXi InSpec Profile from https://github.com/vmware/dod-compliance-and-automation
Expected Result:
For this to function without issue as it does when modules are installed or imported.
Actual Result:
Fails
The text was updated successfully, but these errors were encountered: