From c2a03d1df6c8b02bf9500a52d81f352d0bc9d2ef Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Wed, 2 Oct 2024 16:55:16 +0300 Subject: [PATCH] Fix linux air gapped environments. Add support for PowerShell 7.2 in order to allow running on SDDC Manager. Change version for release. Signed-off-by: Ivaylo Ivanov --- CHANGELOG.md | 4 ++-- VMware.CloudFoundation.PowerManagement.psd1 | 4 ++-- docs/documentation/getting-started/install.md | 11 ++++++++--- docs/snippets/copy-module-local-linux.sh | 2 +- docs/snippets/extract-module-local-linux.sh | 3 +++ docs/snippets/pre-req-linux.ps1 | 2 ++ docs/snippets/pre-req-linux.sh | 1 - docs/snippets/save-module-local-linux.ps1 | 12 +++++++----- 8 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 docs/snippets/extract-module-local-linux.sh create mode 100644 docs/snippets/pre-req-linux.ps1 delete mode 100644 docs/snippets/pre-req-linux.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 3967a9d..4e0b361 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Release History -## v1.4.1 +## v1.5.0 -> Release Date: Unreleased +> Release Date: 2024-10-02 Bugfix: diff --git a/VMware.CloudFoundation.PowerManagement.psd1 b/VMware.CloudFoundation.PowerManagement.psd1 index 2ace48e..a5920af 100644 --- a/VMware.CloudFoundation.PowerManagement.psd1 +++ b/VMware.CloudFoundation.PowerManagement.psd1 @@ -11,7 +11,7 @@ RootModule = 'VMware.CloudFoundation.PowerManagement.psm1' # Version number of this module. - ModuleVersion = '1.4.1.1011' + ModuleVersion = '1.5.0.1000' # Supported PSEditions # CompatiblePSEditions = @() @@ -32,7 +32,7 @@ Description = 'PowerShell Module for VMware Cloud Foundation Power Management' # Minimum version of the Windows PowerShell engine required by this module - PowerShellVersion = '7.4.0' + PowerShellVersion = '7.2.0' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' diff --git a/docs/documentation/getting-started/install.md b/docs/documentation/getting-started/install.md index efaa0ab..52cad46 100644 --- a/docs/documentation/getting-started/install.md +++ b/docs/documentation/getting-started/install.md @@ -46,8 +46,8 @@ Verify that your system has a [supported edition and version](./../index.md#powe Prerequisite for module install on Linux Machine - ```bash - --8<-- "./docs/snippets/pre-req-linux.sh" + ```powershell + --8<-- "./docs/snippets/pre-req-linux.ps1" ``` From a system with an Internet connection, save the module dependencies from the PowerShell Gallery by running the following commands in the PowerShell console: @@ -56,12 +56,17 @@ Verify that your system has a [supported edition and version](./../index.md#powe --8<-- "./docs/snippets/save-module-local-linux.ps1" ``` - From the system with an Internet connection, copy the module dependencies to a target system by running the following commands in the PowerShell console: + From the system with an Internet connection, copy the "OfflineModules.tar.gz" archive to a target system's directory: ```bash --8<-- "./docs/snippets/copy-module-local-linux.sh" ``` + On the target system, extract the archive uploaded in the previous step by running the following commands: + ```bash + --8<-- "./docs/snippets/extract-module-local-linux.sh" + + On the target system, import the module dependencies by running the following commands in the PowerShell console: ```powershell diff --git a/docs/snippets/copy-module-local-linux.sh b/docs/snippets/copy-module-local-linux.sh index de4e7d0..3f032a0 100644 --- a/docs/snippets/copy-module-local-linux.sh +++ b/docs/snippets/copy-module-local-linux.sh @@ -1 +1 @@ -scp -r /home/modules/* username@remote_host:/home/lab/.local/share/powershell/Modules/ \ No newline at end of file +~/.local/share/powershell/Modules/ diff --git a/docs/snippets/extract-module-local-linux.sh b/docs/snippets/extract-module-local-linux.sh new file mode 100644 index 0000000..8176c68 --- /dev/null +++ b/docs/snippets/extract-module-local-linux.sh @@ -0,0 +1,3 @@ +cd ~/.local/share/powershell/Modules/ +tar -zxvf OfflineModules.tar.gz +rm -rf OfflineModules.tar.gz diff --git a/docs/snippets/pre-req-linux.ps1 b/docs/snippets/pre-req-linux.ps1 new file mode 100644 index 0000000..9e481d0 --- /dev/null +++ b/docs/snippets/pre-req-linux.ps1 @@ -0,0 +1,2 @@ +$DownloadDir = "~/DownloadModules" +mkdir $DownloadDir diff --git a/docs/snippets/pre-req-linux.sh b/docs/snippets/pre-req-linux.sh deleted file mode 100644 index f305e4f..0000000 --- a/docs/snippets/pre-req-linux.sh +++ /dev/null @@ -1 +0,0 @@ -mkdir /home/modules \ No newline at end of file diff --git a/docs/snippets/save-module-local-linux.ps1 b/docs/snippets/save-module-local-linux.ps1 index 2a416cb..b6cd9a9 100644 --- a/docs/snippets/save-module-local-linux.ps1 +++ b/docs/snippets/save-module-local-linux.ps1 @@ -1,5 +1,7 @@ -Save-Module -Name VMware.PowerCLI -MinimumVersion 13.3.0 -Path /home/modules -Repository PSGallery -Save-Module -Name PowerVCF -MinimumVersion 2.4.1 -Path /home/modules -Repository PSGallery -Save-Module -Name PowerValidatedSolutions -MinimumVersion 2.11.0 -Path /home/modules -Repository PSGallery -Save-Module -Name Posh-SSH -MinimumVersion 3.0.8 -Path /home/modules -Repository PSGallery -Save-Module -Name VMware.CloudFoundation.PowerManagement -Path /home/modules -Repository PSGallery +Save-Module -Name VMware.PowerCLI -Path $DownloadDir -Repository PSGallery +Save-Module -Name PowerVCF -Path $DownloadDir -Repository PSGallery +Save-Module -Name Posh-SSH -Path $DownloadDir -Repository PSGallery +Save-Module -Name PowerValidatedSolutions -Path $DownloadDir -Repository PSGallery +Save-Module -Name VMware.CloudFoundation.PowerManagement -Path $DownloadDir -Repository PSGallery +cd $DownloadDir +tar -zcvf OfflineModules.tar.gz *