From 1c81693150c5327dff045bab1033b975336ee2dc Mon Sep 17 00:00:00 2001 From: JJ Fullmer Date: Sat, 7 Sep 2024 20:57:15 -0600 Subject: [PATCH] Fix choco template issue of typo of folder name sources vs files --- FogApi/FogApi.psd1 | 8 +-- .../PSGetModule/tools/chocolateyInstall.ps1 | 16 +++-- docs/ReleaseNotes.md | 6 ++ docs/en-us/about_FogApi.help.txt | 63 ++++++++++--------- 4 files changed, 52 insertions(+), 41 deletions(-) diff --git a/FogApi/FogApi.psd1 b/FogApi/FogApi.psd1 index 9120aee..dae42fa 100644 --- a/FogApi/FogApi.psd1 +++ b/FogApi/FogApi.psd1 @@ -3,7 +3,7 @@ # # Generated by: JJ Fullmer # -# Generated on: 9/5/2024 +# Generated on: 9/7/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'FogApi.psm1' # Version number of this module. -ModuleVersion = '2409.9.5' +ModuleVersion = '2409.9.6' # Supported PSEditions # CompatiblePSEditions = @() @@ -305,9 +305,9 @@ PrivateData = @{ # ReleaseNotes of this module ReleaseNotes = ' -# 2409.9.5 +# 2409.9.6 - Updated and unified various docs, added icon packaging with best practicies for chocolatey and psgallery. Updated chocolatey packaging and build functions.' + Fix choco template issue of typo of folder name sources vs files' # Prerelease string of this module # Prerelease = '' diff --git a/chocoTemplate/PSGetModule/tools/chocolateyInstall.ps1 b/chocoTemplate/PSGetModule/tools/chocolateyInstall.ps1 index 123d130..d313f52 100644 --- a/chocoTemplate/PSGetModule/tools/chocolateyInstall.ps1 +++ b/chocoTemplate/PSGetModule/tools/chocolateyInstall.ps1 @@ -58,7 +58,7 @@ ForEach ($destPath in $destinationPath) { } else { #this is the tools dir, make sure to not copy the chocolatey install scripts or psgetxml sources folder to the module install folder try { - Copy-Item $_ -Destination $destPath -Exclude "sources","chocolateyInstall.ps1","chocolateyUninstall.ps1","chocolateyBeforeModify.ps1","PSGetModuleInfo-ps5.xml","PSGetModuleInfo-ps7.xml" -force -Recurse + Copy-Item $_ -Destination $destPath -Exclude "sources","files","chocolateyInstall.ps1","chocolateyUninstall.ps1","chocolateyBeforeModify.ps1","PSGetModuleInfo-ps5.xml","PSGetModuleInfo-ps7.xml" -force -Recurse } catch { if ($compare) { Write-Verbose "The module may have already been installed, ignoring errors" @@ -72,9 +72,9 @@ ForEach ($destPath in $destinationPath) { #copy the psgetmoduleinfo files for the modules Write-Verbose "Copy PSGetModuleInfo xml" if ($destPath -match "\\Powershell\\Modules") { - $psgetXmlSrc = "$toolsDir\sources\PSGetModuleInfo-ps7.xml" + $psgetXmlSrc = "$toolsDir\files\PSGetModuleInfo-ps7.xml" } else { - $psgetXmlSrc = "$toolsDir\sources\PSGetModuleInfo-ps5.xml" + $psgetXmlSrc = "$toolsDir\files\PSGetModuleInfo-ps5.xml" } Copy-Item $psgetXmlSrc "$destPath\PSGetModuleInfo.xml" -Force $psgetxml = Get-Item "$destPath\PSGetModuleInfo.xml" -force; @@ -115,9 +115,13 @@ ForEach ($destPath in $destinationRootPath) { if ($null -ne $oldVersions) { Write-verbose "Taking ownership of path $($_) and setting permissions"; $oldVersions | ForEach-Object { - $takeOwn = start-process -FilePath takeown.exe -ArgumentList "/F `"$($_)`" /R /A /D Y" -wait -NoNewWindow -PassThru -RedirectStandardOutput "C:\logs\takeown-$modulename-paths.log" - Write-Verbose "Take Ownership result is $($takeOwn | out-string) - $(Get-content "C:\logs\takeown-$modulename-paths.log" | out-string)" - Remove-Item "C:\logs\takeown-$modulename-paths.log" -force -Recurse -ea 0; + $logDir = "$env:temp\logs" + if (!(Test-Path $logDir)) { + mkdir $logDir -ea 0; + } + $takeOwn = start-process -FilePath takeown.exe -ArgumentList "/F `"$($_)`" /R /A /D Y" -wait -NoNewWindow -PassThru -RedirectStandardOutput "$logDir\takeown-$modulename-paths.log" + Write-Verbose "Take Ownership result is $($takeOwn | out-string) - $(Get-content "$logDir\takeown-$modulename-paths.log" | out-string)" + Remove-Item "$logDir\takeown-$modulename-paths.log" -force -Recurse -ea 0; } try { $perms = Grant-FullRightsToPath -path $oldVersions -recurseInherit -ea stop -wa 0 -wait -NoOutHost diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 1930321..d983dd1 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -2,6 +2,11 @@ ## 9.x +### 2409.9.6 + + Fix choco template issue of typo of folder name sources vs files + + ### 2409.9.5 Updated and unified various docs, added icon packaging with best practicies for chocolatey and psgallery. Updated chocolatey packaging and build functions. @@ -390,5 +395,6 @@ + diff --git a/docs/en-us/about_FogApi.help.txt b/docs/en-us/about_FogApi.help.txt index d1984d3..465d0a2 100644 --- a/docs/en-us/about_FogApi.help.txt +++ b/docs/en-us/about_FogApi.help.txt @@ -14,11 +14,13 @@ LONG DESCRIPTION or to simply have a command line method of controlling fog operations. This essentially gives you a crossplatform commandline interface for fog tasks and makes many things easier to automate. + Docs for this module can be found at https://fogapi.readthedocs.io/en/latest/ For more information about FOG see - * https://FOGProject.org - * https://docs.fogproject.org - * https://github.com/FOGProject - * https://github.com/FOGProject/fogproject + - https://FOGProject.org + - https://docs.fogproject.org + - https://github.com/FOGProject + - https://github.com/FOGProject/fogproject + - https://forums.fogproject.org VERSIONING The versioning of this module follows this pattern @@ -51,11 +53,11 @@ Installation Methods To Install this module follow these steps INSTALL FROM PSGALLERY - * Easiest method: Install from PSGallery + - Easiest method: Install from PSGallery https://www.powershellgallery.com/packages/FogApi with powershellget or - PSResourceGet * `Install-Module -name FogApi -Scope AllUsers` * - `Install-PSResource -Name FogApi -scope -Scope AllUsers` * updating is then - as easy as * `Update-Module -name FogApi` * `Update-PSResource -Name + PSResourceGet - `Install-Module -name FogApi -Scope AllUsers` - + `Install-PSResource -Name FogApi -scope -Scope AllUsers` - updating is then + as easy as - `Update-Module -name FogApi` - `Update-PSResource -Name FogApi` INSTALL WITH CHOCOLATEY @@ -63,38 +65,37 @@ Installation Methods that manually installs the module the same way the PSGet managers do. https://community.chocolatey.org/packages/FogApi See https://chocolatey.org for more information on chocolatey package manager - * Install with chocolatey (will install the module by copying the built + - Install with chocolatey (will install the module by copying the built version to the powershell core and windows powershell paths, will remove any - existing versions) * `choco install fogapi -y` * Upgrading is as easy as - (note that you can also use this same command for a new install) * + existing versions) - `choco install fogapi -y` - Upgrading is as easy as + (note that you can also use this same command for a new install) - `choco upgrade fogapi -y` Manual Installation USE ASSETS FROM THE RELEASE - Use Chocolatey, PackageManagement, Nuget or what have you to install the - chocolatey.nupkg or *.psgallery.nupkg file from the release assets - Extract the - builtModule.zip from the release and run `import-module` on the resulting - folder for a portable installation. You can also extract to the paths - outlined below in the manual build install steps for a more system wide - install + - Use Chocolatey, PackageManagement, Nuget or what have you to install the + chocolatey.nupkg or + .psgallery.nupkg file from the release assets - Extract the *builtModule.zip + from the release and run `import-module` on the resulting folder for a + portable installation. You can also extract to the paths outlined below in + the manual build install steps for a more system wide install MANUALLY BUILD THE MODULE - * Manual Method: - * download the zip of this repo and extract it (or use git clone) * Or + - Manual Method: + - download the zip of this repo and extract it (or use git clone) - Or clone the repo using your favorite git tool, you just need the FogApi Folder - this readme is in * Run the build.ps1 script - * Copy the built module folder (._module_build) into... * For Windows - Powershell v3-v5.1 * C:\Program - Files\WindowsPowershell\Modules\FogApi * For Powershell Core (pwsh) on - Windows v7+ * C:\Program Files\PowerShell\Modules\FogApi * For - Linux Powershell Core (pwsh) v7+ * - /usr/local/share/powershell/Modules/FogApi * For Mac Powershell Core - (pwsh) v7+ (untested) * /usr/local/share/powershell/Modules/FogApi - * I haven't tested this on a mac, the module folder may be + this readme is in - Run the build.ps1 script + - Copy the built module folder (._module_build) into... - For Windows + Powershell v3-v5.1 - C:\Program + Files\WindowsPowershell\Modules\FogApi - For Powershell Core (pwsh) on + Windows v7+ - C:\Program Files\PowerShell\Modules\FogApi - For + Linux Powershell Core (pwsh) v7+ - + /usr/local/share/powershell/Modules/FogApi - For Mac Powershell Core + (pwsh) v7+ (untested) - /usr/local/share/powershell/Modules/FogApi + - I haven't tested this on a mac, the module folder may be somewhere else this is based on where it is in other powershell - core installs * Open powershell (as admin recommended) - * Run `Import-Module FogApi` + core installs - Open powershell (as admin recommended) + - Run `Import-Module FogApi` The module is now installed. UPDATE FROM PSGALLERY