Open lamw opened 4 years ago
@lamw pwsh7.03 uses the latest dotnet-runtime. Hence, update-module pwsh7.0 to 7.03 on photon produces some issues on x86, too. ARM BoM in mind, does pwsh7.0.0 & PowerCLI12.0 install successfully?
@dcasota Powershell 7.0.3 installs and runs fine. Its when I attempt to install PowerCLI (see command output above) where the error occurs.
These exact instructions work when using Ubuntu 20.0.4
(edited 12.10.2020)
@lamw When running on Photon OS 2.0, two workarounds are necessary to be saved in profile /opt/microsoft ~/powershell/profile.ps1. Here's the code (edited):
OUTPUT=`~/powershell/pwsh -c "find-module VMware.PowerCLI"`
if ! (echo $OUTPUT | grep -q "PSGallery"); then
cat <<EOFProfile > ~/powershell/profile.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
\$env:DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
EOFProfile
fi
Without those, it's the identical error message, not on exactly same line exception though. Each time pwsh7.0.3 is started the saved profile with the workarounds is loaded.
The source snippets are from:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-5.1&redirectedfrom=MSDN
Show variables of $PROFILE:
$PROFILE | Get-Member -Type NoteProperty
Workaround 1:
https://github.com/PowerShell/PowerShellGet/issues/447#issuecomment-476968923
Change to TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Workaround #2
https://github.com/PowerShell/PowerShell/issues/9495#issuecomment-515592672
$env:DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
Powershell 7.0.3 its PackageManagement 1.4.7 has "Update security protocol to use TLS 1.2" as release comment, hence TLS 1.2 seems to have become mandatory.
Using a setup photon-3.0-1ca1d7be-aarch64.iso with Ubuntu 20.04.1 LTS sd card on ESXi-ARM on a Raspberry Pi4 Model B, a tested feedback these days should be possible as well (I'm struggling actually with the 7" touch screen, don't ask :-/ ). the workaround is a temporary option.
@ssahani Has something changed for powershell
on Photon OS aarch64? There seems to be no package anymore, see
pwsh. dotnet-runtime
is missing, btw.
Side installation works, I've used this test setup Pwsh7.3.0-preview.1OnPhotonOS.sh.zip, but powershell command history does not work (maybe a powershell issue on aarch64?).
In addition, install-module -name VMware.PowerCLI
throws some (debug) log warnings.
[...]
Path: /root/.local/share/powershell/Modules/VMware.VimAutomation.Sdk/12.5.0.19093564/netcoreapp3.1/ParameterCompleter.ps1
Jan 23 23:23:51 photon-f72a20e6dbfc powershell[930]: pwsh Warning: 0 :
Jan 23 23:23:51 photon-f72a20e6dbfc powershell[930]: Unable to load settings file : /root/.local/share/VMware/PowerCLI/PowerCLI_Settings.xml. Error: System.IO.DirectoryNotFoundException: Could not find a part of the path '/root/.local/share/VMware/PowerCLI/PowerCLI_Settings.xml'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at VMware.VimAutomation.ViCore.Util10.Settings.FileSettingsStore.LoadFileSettings(SettingsStore settings)
at VMware.VimAutomation.ViCore.Util10.Settings.FileSettingsStore.LoadSettings()
Jan 23 23:23:51 photon-f72a20e6dbfc powershell[930]: pwsh Warning: 0 :
/cc @YustasSwamp
With ESXi-Arm Fling now available. I wanted to have PowerCLI running within Photon OS 3.0 AARCH64. The steps below is what I used to successfully install Powershell Arm, but when attempting to install the PowerCLI Module, it throws an error.
FYI - This works perfectly fine when using Ubuntu 20.04 AARCH64