From d41e3baefbbaf3e24d1c8812529e96043afff15a Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Fri, 11 Oct 2024 09:04:43 +1100 Subject: [PATCH] Update scripts --- scripts/README.md | 4 +- scripts/image/000_PrepImage.ps1 | 25 ++- scripts/image/011_SupportFunctions.ps1 | 1 - scripts/image/013_RegionLanguage.ps1 | 24 ++- scripts/image/014_RolesFeatures.ps1 | 138 +++++++++------- scripts/image/015_Customise.ps1 | 6 +- ...AgentMicrosoftWvdMultimediaRedirection.ps1 | 4 +- .../101_Avd-AgentMicrosoftWvdRtcService.ps1 | 4 +- scripts/image/102_MicrosoftFSLogixApps.ps1 | 4 +- scripts/image/103_MicrosoftNET.ps1 | 6 +- scripts/image/104_MicrosoftEdge.ps1 | 4 +- scripts/image/200_MicrosoftOneDrive.ps1 | 2 +- scripts/image/201_MicrosoftTeams.ps1 | 2 +- scripts/image/201_MicrosoftTeamsClassic.ps1 | 147 ------------------ scripts/image/210_MicrosoftPowerToys.ps1 | 4 +- .../image/211_MicrosoftVisualStudioCode.ps1 | 6 +- ...212_MicrosoftSQLServerManagementStudio.ps1 | 6 +- ...213_MicrosoftAzureVirtualDesktopClient.ps1 | 6 +- scripts/image/214_MicrosoftAzureCLI.ps1 | 6 +- scripts/image/215_MicrosoftPowerShell.ps1 | 6 +- scripts/image/400_AdobeAcrobatReaderDC.ps1 | 4 +- scripts/image/401_FoxitPDFReader.ps1 | 6 +- scripts/image/402_ZoomMeetings.ps1 | 6 +- scripts/image/403_GoogleChrome.ps1 | 4 +- scripts/image/404_NotepadPlusPlus.ps1 | 4 +- scripts/image/406_VLCMediaPlayer.ps1 | 4 +- scripts/image/407_7Zip.ps1 | 2 +- scripts/image/408_RemoteDesktopAnalyzer.ps1 | 2 +- scripts/image/409_CiscoWebEx.ps1 | 4 +- scripts/image/410_ImageGlass.ps1 | 4 +- scripts/image/411_draw.io.ps1 | 6 +- scripts/image/412_MozillaFirefox.ps1 | 4 +- scripts/image/413_Paint.NET.ps1 | 4 +- scripts/image/414_Greenshot.ps1 | 4 +- scripts/image/415_FoxitPDFEditor.ps1 | 4 +- scripts/image/417_CitrixWorkspaceApp.ps1 | 2 +- scripts/image/420_1Password.ps1 | 4 +- scripts/image/421_1PasswordCli.ps1 | 2 +- scripts/image/999_CleanupImage.ps1 | 116 ++++++++++---- scripts/optimise/Install-CitrixOptimizer.ps1 | 4 +- scripts/optimise/Install-MicrosoftVdot.ps1 | 2 +- scripts/others/418_Synapse.ps1 | 4 +- .../others/499_CrowdStrikeWindowsSensor.ps1 | 4 +- .../Install-FSLogixAppMaskingRuleset.ps1 | 2 +- scripts/uninstall/Uninstall-7ZipZS.ps1 | 2 +- scripts/uninstall/Uninstall-AdobeAcrobat.ps1 | 4 +- scripts/uninstall/Uninstall-CiscoWebEx.ps1 | 4 +- .../uninstall/Uninstall-FoxitPDFEditor.ps1 | 4 +- .../uninstall/Uninstall-FoxitPDFReader.ps1 | 4 +- scripts/uninstall/Uninstall-GoogleChrome.ps1 | 4 +- scripts/uninstall/Uninstall-ImageGlass.ps1 | 4 +- .../Uninstall-MicrosoftAvdMsMmrHost.ps1 | 4 +- .../Uninstall-MicrosoftAvdWebRTC.ps1 | 4 +- .../Uninstall-MicrosoftFSLogixApps.ps1 | 4 +- scripts/uninstall/Uninstall-MicrosoftNET.ps1 | 4 +- .../uninstall/Uninstall-MicrosoftOneDrive.ps1 | 2 +- .../Uninstall-MicrosoftPowerToys.ps1 | 4 +- .../uninstall/Uninstall-MicrosoftTeams.ps1 | 4 +- .../Uninstall-MicrosoftVisualStudioCode.ps1 | 2 +- .../uninstall/Uninstall-MozillaFirefox.ps1 | 2 +- .../uninstall/Uninstall-NotepadPlusPlus.ps1 | 2 +- scripts/uninstall/Uninstall-Paint.NET.ps1 | 4 +- .../uninstall/Uninstall-VLCMediaPlayer.ps1 | 4 +- scripts/uninstall/Uninstall-ZoomMeetings.ps1 | 4 +- scripts/uninstall/Uninstall-draw.io.ps1 | 4 +- .../Uninstall-pdfForgePDFCreator.ps1 | 4 +- support/405_pdfforgePDFCreator.ps1 | 2 +- tests/scripts/3_RunImageScripts.Tests.ps1 | 2 +- variables/NerdioManagerVariables.json | 48 +----- 69 files changed, 324 insertions(+), 413 deletions(-) delete mode 100644 scripts/image/201_MicrosoftTeamsClassic.ps1 diff --git a/scripts/README.md b/scripts/README.md index 1c704d8..9eb53e7 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -6,7 +6,7 @@ Image scripts for customising Windows 10/11 Enterprise and Enterprise multi-sess Scripts use [Evergreen](https://stealthpuppy.com/evergreen/) to determine the latest version of an application. Running each script will install the latest version on a clean image or update an existing application install on a gold image or existing session hosts. -Where supported, application installers will save install logs to `$Env:ProgramData\Nerdio\Logs`. +Where supported, application installers will save install logs to `$Env:SystemRoot\Logs\ImageBuild`. | **Script** | **Notes** | |-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -51,4 +51,4 @@ Once run on the target VM, the VM or image should have the specified application Scripts here will uninstall target applications. Run on gold images or target session hosts when users are not signed in, as applications will be forcibly uninstalled. -Where supported, uninstall commands will save uninstall logs to `$Env:ProgramData\Nerdio\Logs`. +Where supported, uninstall commands will save uninstall logs to `$Env:SystemRoot\Logs\ImageBuild`. diff --git a/scripts/image/000_PrepImage.ps1 b/scripts/image/000_PrepImage.ps1 index bbeca5c..bca13e6 100644 --- a/scripts/image/000_PrepImage.ps1 +++ b/scripts/image/000_PrepImage.ps1 @@ -20,26 +20,35 @@ for customization. It performs the following tasks: #execution mode: Combined #tags: Image +# If we're on Windows 11, configure the registry settings if ((Get-CimInstance -ClassName "CIM_OperatingSystem").Caption -like "Microsoft Windows 1*") { + # Prevent Windows from installing stuff during deployment reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /d 1 /t "REG_DWORD" /f | Out-Null reg add "HKLM\Software\Policies\Microsoft\WindowsStore" /v "AutoDownload" /d 2 /t "REG_DWORD" /f | Out-Null + + # https://www.reddit.com/r/Windows11/comments/17toy5k/prevent_automatic_installation_of_outlook_and_dev/ + reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate" /f | Out-Null + reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate" /f | Out-Null + reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate" /f | Out-Null + reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate" /f | Out-Null + + # https://learn.microsoft.com/en-us/windows/deployment/update/waas-wu-settings#allow-windows-updates-to-install-before-initial-user-sign-in + reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator" /v "ScanBeforeInitialLogonAllowed" /d 1 /t "REG_DWORD" /f | Out-Null } -# Start menu customisation -# reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SpecialRoamingOverrideAllowed /t REG_DWORD /d 1 /f - -# Enable time zone redirection -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fEnableTimeZoneRedirection /t REG_DWORD /d 1 /f +# Enable time zone redirection - this can be configure via policy as well +Write-LogFile -Message "Enable time zone redirection" -LogLevel 1 +reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fEnableTimeZoneRedirection" /t "REG_DWORD" /d 1 /f # Create logs directory and compress -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $params = @{ FilePath = "$Env:SystemRoot\System32\compact.exe" - ArgumentList = "/C /S `"$Env:ProgramData\Nerdio\Logs`"" + ArgumentList = "/C /S `"$Env:SystemRoot\Logs\ImageBuild`"" NoNewWindow = $true Wait = $true PassThru = $true ErrorAction = "Stop" } -Start-Process @params *> $null +Start-Process @params | Out-Null diff --git a/scripts/image/011_SupportFunctions.ps1 b/scripts/image/011_SupportFunctions.ps1 index a0a43f6..1abbede 100644 --- a/scripts/image/011_SupportFunctions.ps1 +++ b/scripts/image/011_SupportFunctions.ps1 @@ -23,7 +23,6 @@ Runs the script to install the required PowerShell modules for building AVD imag # Trust the PSGallery for modules [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 Install-PackageProvider -Name "NuGet" -MinimumVersion "2.8.5.208" -Force -ErrorAction "SilentlyContinue" -#Install-Module -Name PowerShellGet -Force -AllowClobber Install-PackageProvider -Name "PowerShellGet" -MinimumVersion "2.2.5" -Force -ErrorAction "SilentlyContinue" foreach ($Repository in "PSGallery") { if (Get-PSRepository | Where-Object { $_.Name -eq $Repository -and $_.InstallationPolicy -ne "Trusted" }) { diff --git a/scripts/image/013_RegionLanguage.ps1 b/scripts/image/013_RegionLanguage.ps1 index abc510e..f15018a 100644 --- a/scripts/image/013_RegionLanguage.ps1 +++ b/scripts/image/013_RegionLanguage.ps1 @@ -43,23 +43,19 @@ else { } #endregion -#region Enable the WinRM rule as a workaround for VM provisioning DSC failure with: "Unable to check the status of the firewall" -# https://github.com/Azure/RDS-Templates/issues/435 -# https://qiita.com/fujinon1109/items/440c614338fe2535b09e +#region Only run if the LanguagePackManagement module is installed +# Works for Windows 11, test on Windows Server 2025 +if (Get-Module -Name "LanguagePackManagement" -ListAvailable) { -Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory "Private" -Get-NetFirewallRule -DisplayGroup "Windows Remote Management" | Enable-NetFirewallRule -Enable-PSRemoting -Force -Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory "Public" -#endregion + # Enable the WinRM rule as a workaround for VM provisioning DSC failure with: "Unable to check the status of the firewall" + # https://github.com/Azure/RDS-Templates/issues/435 + # https://qiita.com/fujinon1109/items/440c614338fe2535b09e -# Disable LanguageComponentsInstaller while installing language packs -# See Bug 45044965: Installing language pack fails with error: ERROR_SHARING_VIOLATION for more details -# Disable-ScheduledTask -TaskName "\Microsoft\Windows\LanguageComponentsInstaller\Installation" -# Disable-ScheduledTask -TaskName "\Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources" + Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory "Private" + Get-NetFirewallRule -DisplayGroup "Windows Remote Management" | Enable-NetFirewallRule + Enable-PSRemoting -Force + Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory "Public" -#region Only run if the LanguagePackManagement module is installed -if (Get-Module -Name "LanguagePackManagement" -ListAvailable) { $params = @{ Language = $Language CopyToSettings = $true diff --git a/scripts/image/014_RolesFeatures.ps1 b/scripts/image/014_RolesFeatures.ps1 index 7718a45..a33bfbc 100644 --- a/scripts/image/014_RolesFeatures.ps1 +++ b/scripts/image/014_RolesFeatures.ps1 @@ -5,56 +5,72 @@ Configures Windows roles, features, and capabilities by enabling or disabling Wi .DESCRIPTION This script is used to configure Windows roles, features, and capabilities on different versions of Windows, including Windows Server, Windows 11, and Windows 10. It enables or disables specific Windows roles and features based on the operating system version. - -.PARAMETER None - -.EXAMPLE -.\014_RolesFeatures.ps1 #> - -#description: Configures Windows roles, features and capabilities. Enable/disable Windows roles and features -#execution mode: IndividualWithRestart -#tags: Roles, Features, Capabilities, Image +[CmdletBinding(SupportsShouldProcess = $false)] +param () #region Script logic # Add / Remove roles and features (requires reboot at end of deployment) switch -Regex ((Get-CimInstance -ClassName "CIM_OperatingSystem").Caption) { #region Windows Server "Microsoft Windows Server*" { - $params = @{ - FeatureName = "Printing-XPSServices-Features", "AzureArcSetup" - Online = $true - NoRestart = $true - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" + $Features = @("Printing-XPSServices-Features", "AzureArcSetup", "WindowsServerBackupSnapin", "WindowsServerBackup") + foreach ($Feature in $Features) { + $params = @{ + FeatureName = $Feature + Online = $true + NoRestart = $true + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" + } + Disable-WindowsOptionalFeature @params + } + + $Features = @("RDS-RD-Server", "Server-Media-Foundation", "Search-Service", "Remote-Assistance") # "NET-Framework-Core" + foreach ($Feature in $Features) { + $params = @{ + Name = $Feature + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" + } + Write-LogFile -Message "Install-WindowsFeature: $Feature" -LogLevel 1 + Install-WindowsFeature @params } - Disable-WindowsOptionalFeature @params - $params = @{ - Name = "RDS-RD-Server", "Server-Media-Foundation", "Search-Service", "NET-Framework-Core", "Remote-Assistance" - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" + # Remove other capabilities + $Capabilities = @("App.StepsRecorder~~~~0.0.1.0", + "Browser.InternetExplorer~~~~0.0.11.0", + "Downlevel.NLS.Sorting.Versions.Server~~~~0.0.1.0", + "MathRecognizer~~~~0.0.1.0", + "Media.WindowsMediaPlayer~~~~0.0.12.0", + "Microsoft.Windows.MSPaint~~~~0.0.1.0", + "Microsoft.Windows.PowerShell.ISE~~~~0.0.1.0", + "Microsoft.Windows.WordPad~~~~0.0.1.0", + "XPS.Viewer~~~~0.0.1.0") + foreach ($Capability in $Capabilities) { + Write-LogFile -Message "Remove-Capability: $Capability" -LogLevel 1 + & "$Env:SystemRoot\System32\dism.exe" /Online /Remove-Capability /CapabilityName:$Capability /NoRestart /Quiet } - Install-WindowsFeature @params # Remove Azure Arc Setup from running at sign-in reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "AzureArcSetup" /f | Out-Null + # Remove unnecessary shortcuts + Remove-Item -Path "$Env:ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Microsoft Azure services.lnk" + # Enable services - if ((Get-WindowsFeature -Name "RDS-RD-Server").InstallState -eq "Installed") { - foreach ($service in "Audiosrv", "WSearch") { - try { - $params = @{ - Name = $service - StartupType = "Automatic" - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" - } - Set-Service @params - } - catch { - $_.Exception.Message + foreach ($service in "Audiosrv", "WSearch") { + try { + $params = @{ + Name = $service + StartupType = "Automatic" + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" } + Set-Service @params + } + catch { + $_.Exception.Message } } break @@ -63,44 +79,54 @@ switch -Regex ((Get-CimInstance -ClassName "CIM_OperatingSystem").Caption) { #region Windows 11 "Microsoft Windows 11 Enterprise*|Microsoft Windows 11 Pro*" { - $params = @{ - FeatureName = "Printing-XPSServices-Features", "SMB1Protocol", "WorkFolders-Client", "MicrosoftWindowsPowerShellV2Root", "MicrosoftWindowsPowerShellV2" - Online = $true - NoRestart = $true - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" + $Features = @("Printing-XPSServices-Features", "SMB1Protocol", "WorkFolders-Client", "MicrosoftWindowsPowerShellV2Root", "MicrosoftWindowsPowerShellV2") + foreach ($Feature in $Features) { + $params = @{ + FeatureName = $Feature + Online = $true + NoRestart = $true + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" + } + Disable-WindowsOptionalFeature @params } - Disable-WindowsOptionalFeature @params break } #endregion #region Windows 10 "Microsoft Windows 10 Enterprise*|Microsoft Windows 10 Pro*" { - $params = @{ - FeatureName = "Printing-XPSServices-Features", "SMB1Protocol", "WorkFolders-Client", ` + $Features = @("Printing-XPSServices-Features", "SMB1Protocol", "WorkFolders-Client", ` "FaxServicesClientPackage", "WindowsMediaPlayer", "MicrosoftWindowsPowerShellV2Root", ` - "MicrosoftWindowsPowerShellV2" - Online = $true - NoRestart = $true - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" + "MicrosoftWindowsPowerShellV2") + foreach ($Feature in $Features) { + $params = @{ + FeatureName = $Feature + Online = $true + NoRestart = $true + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" + } + Disable-WindowsOptionalFeature @params } - Disable-WindowsOptionalFeature @params - $params = @{ - Name = "Media.WindowsMediaPlayer~~~~0.0.12.0", "XPS.Viewer~~~~0.0.1.0", ` + $Features = @("Media.WindowsMediaPlayer~~~~0.0.12.0", "XPS.Viewer~~~~0.0.1.0", ` "App.Support.QuickAssist~~~~0.0.1.0", "MathRecognizer~~~~0.0.1.0", ` - "Browser.InternetExplorer~~~~0.0.11.0", "Print.Fax.Scan~~~~0.0.1.0" - IncludeManagementTools = $true - WarningAction = "SilentlyContinue" - ErrorAction = "SilentlyContinue" + "Browser.InternetExplorer~~~~0.0.11.0", "Print.Fax.Scan~~~~0.0.1.0") + foreach ($Feature in $Features) { + $params = @{ + Name = $Feature + IncludeManagementTools = $true + WarningAction = "SilentlyContinue" + ErrorAction = "SilentlyContinue" + } + Uninstall-WindowsFeature @params } - Uninstall-WindowsFeature @params break } #endregion default { + Write-LogFile -Message "Failed to determine OS" -LogLevel 1 } } diff --git a/scripts/image/015_Customise.ps1 b/scripts/image/015_Customise.ps1 index 829a2a5..ee4cfb9 100644 --- a/scripts/image/015_Customise.ps1 +++ b/scripts/image/015_Customise.ps1 @@ -46,9 +46,13 @@ New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue $Installer = Get-EvergreenApp -Name "stealthpuppyWindowsCustomisedDefaults" | Where-Object { $_.Type -eq "zip" } | ` Select-Object -First 1 | ` Save-EvergreenApp -CustomPath $Path + +# Extract the installer Expand-Archive -Path $Installer.FullName -DestinationPath $Path -Force $InstallFile = Get-ChildItem -Path $Path -Recurse -Include "Install-Defaults.ps1" + +# Install the Customised Defaults Push-Location -Path $InstallFile.Directory -& .\Install-Defaults.ps1 -Language $Language -TimeZone $TimeZone -AppxMode $AppxMode +& $InstallFile.FullName -Language $Language -TimeZone $TimeZone -AppxMode $AppxMode Pop-Location #endregion diff --git a/scripts/image/101_Avd-AgentMicrosoftWvdMultimediaRedirection.ps1 b/scripts/image/101_Avd-AgentMicrosoftWvdMultimediaRedirection.ps1 index 9145f9d..eff688d 100644 --- a/scripts/image/101_Avd-AgentMicrosoftWvdMultimediaRedirection.ps1 +++ b/scripts/image/101_Avd-AgentMicrosoftWvdMultimediaRedirection.ps1 @@ -23,7 +23,7 @@ The path where the agents will be downloaded. The default path is "$Env:SystemDr #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Run tasks/install apps #region Microsoft Azure Virtual Desktop Multimedia Redirection Extensions @@ -40,7 +40,7 @@ catch { } # Install MMR -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftWvdMultimediaRedirection$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftWvdMultimediaRedirection$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /log $LogFile" diff --git a/scripts/image/101_Avd-AgentMicrosoftWvdRtcService.ps1 b/scripts/image/101_Avd-AgentMicrosoftWvdRtcService.ps1 index 23ab4db..27f7410 100644 --- a/scripts/image/101_Avd-AgentMicrosoftWvdRtcService.ps1 +++ b/scripts/image/101_Avd-AgentMicrosoftWvdRtcService.ps1 @@ -23,7 +23,7 @@ The path where the agents will be downloaded. The default path is "$Env:SystemDr #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Run tasks/install apps #region Microsoft Remote Desktop WebRTC Redirector Service @@ -40,7 +40,7 @@ catch { } # Install RTC -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftWvdRtcService$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftWvdRtcService$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /log $LogFile" diff --git a/scripts/image/102_MicrosoftFSLogixApps.ps1 b/scripts/image/102_MicrosoftFSLogixApps.ps1 index 33ef256..a311eeb 100644 --- a/scripts/image/102_MicrosoftFSLogixApps.ps1 +++ b/scripts/image/102_MicrosoftFSLogixApps.ps1 @@ -64,7 +64,7 @@ $Versions = @" #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download and unpack Import-Module -Name "Evergreen" -Force @@ -94,7 +94,7 @@ Expand-Archive -Path $OutFile.FullName -DestinationPath $Path -Force foreach ($file in "FSLogixAppsSetup.exe") { $Installers = Get-ChildItem -Path $Path -Recurse -Include $file | Where-Object { $_.Directory -match "x64" } foreach ($Installer in $Installers) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\$($Installer.Name)$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\$($Installer.Name)$($App.Version).log" -replace " ", "" $params = @{ FilePath = $Installer.FullName ArgumentList = "/install /quiet /norestart /log $LogFile" diff --git a/scripts/image/103_MicrosoftNET.ps1 b/scripts/image/103_MicrosoftNET.ps1 index 3e78803..8cb9254 100644 --- a/scripts/image/103_MicrosoftNET.ps1 +++ b/scripts/image/103_MicrosoftNET.ps1 @@ -15,7 +15,7 @@ Installs the Microsoft .NET Desktop LTS and Current Runtimes using the default i .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file at "$Env:ProgramData\Nerdio\Logs\Microsoft.NET.log" to capture installation logs. +- The script creates a log file at "$Env:SystemRoot\Logs\ImageBuild\Microsoft.NET.log" to capture installation logs. #> #description: Installs the Microsoft .NET Desktop LTS @@ -26,7 +26,7 @@ Installs the Microsoft .NET Desktop LTS and Current Runtimes using the default i #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download Import-Module -Name "Evergreen" -Force @@ -35,7 +35,7 @@ $App = Get-EvergreenApp -Name "Microsoft.NET" | ` $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" foreach ($file in $OutFile) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\Microsoft.NET.log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\Microsoft.NET.log" -replace " ", "" $params = @{ FilePath = $file.FullName ArgumentList = "/install /quiet /norestart /log $LogFile" diff --git a/scripts/image/104_MicrosoftEdge.ps1 b/scripts/image/104_MicrosoftEdge.ps1 index fa04097..5fe0186 100644 --- a/scripts/image/104_MicrosoftEdge.ps1 +++ b/scripts/image/104_MicrosoftEdge.ps1 @@ -26,7 +26,7 @@ The path where Microsoft Edge will be downloaded. #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null #region Edge # Download @@ -40,7 +40,7 @@ $File = Get-ChildItem -Path $EdgeExe if (!(Test-Path -Path $EdgeExe) -or ([System.Version]$File.VersionInfo.ProductVersion -lt [System.Version]$App.Version)) { # Install - $LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftEdge$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftEdge$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /norestart DONOTCREATEDESKTOPSHORTCUT=true /log $LogFile" diff --git a/scripts/image/200_MicrosoftOneDrive.ps1 b/scripts/image/200_MicrosoftOneDrive.ps1 index ffb01d5..307d943 100644 --- a/scripts/image/200_MicrosoftOneDrive.ps1 +++ b/scripts/image/200_MicrosoftOneDrive.ps1 @@ -29,7 +29,7 @@ This example runs the script and installs the latest version of Microsoft OneDri #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Run tasks/install apps Import-Module -Name "Evergreen" -Force diff --git a/scripts/image/201_MicrosoftTeams.ps1 b/scripts/image/201_MicrosoftTeams.ps1 index a0951be..c207d97 100644 --- a/scripts/image/201_MicrosoftTeams.ps1 +++ b/scripts/image/201_MicrosoftTeams.ps1 @@ -82,7 +82,7 @@ function Get-InstalledSoftware { #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download Teams v2 Bootstrap installer $App = [PSCustomObject]@{ diff --git a/scripts/image/201_MicrosoftTeamsClassic.ps1 b/scripts/image/201_MicrosoftTeamsClassic.ps1 deleted file mode 100644 index 51e53f4..0000000 --- a/scripts/image/201_MicrosoftTeamsClassic.ps1 +++ /dev/null @@ -1,147 +0,0 @@ -<# -.SYNOPSIS -Installs the latest Microsoft Teams per-machine for use on Windows 10/11 multi-session or Windows Server. - -.DESCRIPTION -This script installs the latest version of Microsoft Teams per-machine. -It first checks if the Teams application is already installed and, if so, uninstalls it. -Then it downloads the latest version of Teams using the Evergreen module and installs it. -Finally, it optimizes Teams for multi-session without GPU support by deleting the registry auto-start and updating the default profile. - -.PARAMETER Path -The download path for Microsoft Teams. -#> - -#description: Installs the latest Microsoft Teams per-machine for use on Windows 10/11 multi-session or Windows Server -#execution mode: Combined -#tags: Evergreen, Microsoft, Teams, per-machine -#Requires -Modules Evergreen -[System.String] $Path = "$Env:SystemDrive\Apps\Microsoft\Teams" -[System.String] $TeamsExe = "${env:ProgramFiles(x86)}\Microsoft\Teams\current\Teams.exe" - -#region Functions -function Get-InstalledSoftware { - [OutputType([System.Object[]])] - [CmdletBinding()] - param () - $UninstallKeys = @( - "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*", - "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", - "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" - ) - $Apps = @() - foreach ($Key in $UninstallKeys) { - try { - $propertyNames = "DisplayName", "DisplayVersion", "Publisher", "UninstallString", "PSPath", "WindowsInstaller", "InstallDate", "InstallSource", "HelpLink", "Language", "EstimatedSize", "SystemComponent" - $Apps += Get-ItemProperty -Path $Key -Name $propertyNames -ErrorAction "SilentlyContinue" | ` - . { process { if ($null -ne $_.DisplayName) { $_ } } } | ` - Where-Object { $_.SystemComponent -ne 1 } | ` - Select-Object -Property @{n = "Name"; e = { $_.DisplayName } }, @{n = "Version"; e = { $_.DisplayVersion } }, "Publisher", "UninstallString", @{n = "RegistryPath"; e = { $_.PSPath -replace "Microsoft.PowerShell.Core\\Registry::", "" } }, "PSChildName", "WindowsInstaller", "InstallDate", "InstallSource", "HelpLink", "Language", "EstimatedSize" | ` - Sort-Object -Property "DisplayName", "Publisher" - } - catch { - throw $_ - } - } - return $Apps -} -#endregion - -#region Script logic -New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null - -#region Use Secure variables in Nerdio Manager to pass a JSON file with the variables list -if ([System.String]::IsNullOrEmpty($SecureVars.VariablesList)) { - [System.String] $Language = "en-AU" -} -else { - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - $params = @{ - Uri = $SecureVars.VariablesList - UseBasicParsing = $true - ErrorAction = "Stop" - } - $Variables = Invoke-RestMethod @params - [System.String] $Language = $Variables.$AzureRegionName.Language -} -#endregion - -# Download Teams -Import-Module -Name "Evergreen" -Force -$App = Get-EvergreenApp -Name "MicrosoftTeamsClassic" | ` - Where-Object { $_.Architecture -eq "x64" -and $_.Ring -eq "General" -and $_.Type -eq "msi" } | Select-Object -First 1 -$OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" - -# Uninstall the existing Teams -if (Test-Path -Path $TeamsExe) { - $File = Get-ChildItem -Path $TeamsExe - if ([System.Version]$File.VersionInfo.ProductVersion -le [System.Version]$App.Version) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoftTeams$($File.VersionInfo.ProductVersion).log" -replace " ", "" - $params = @{ - FilePath = "$Env:SystemRoot\System32\msiexec.exe" - ArgumentList = "/x `"$($OutFile.FullName)`" /quiet /log $LogFile" - NoNewWindow = $true - Wait = $true - PassThru = $true - ErrorAction = "Stop" - } - Start-Process @params - - $Folders = "${env:ProgramFiles(x86)}\Microsoft\Teams", ` - "${env:ProgramFiles(x86)}\Microsoft\TeamsMeetingAddin", ` - "${env:ProgramFiles(x86)}\Microsoft\TeamsPresenceAddin" - Remove-Item -Path $Folders -Recurse -Force -ErrorAction "Ignore" - } -} - -$Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Teams Machine-Wide Installer" } -foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoftTeamsMachineWideInstaller$($App.Version).log" -replace " ", "" - $params = @{ - FilePath = "$Env:SystemRoot\System32\msiexec.exe" - ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" - NoNewWindow = $true - PassThru = $true - Wait = $true - ErrorAction = "Stop" - } - Start-Process @params -} - -# Install Teams -New-Item -Path "HKLM:\SOFTWARE\Microsoft\Teams" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Teams" -Name "IsWVDEnvironment" -PropertyType "DWORD" -Value 1 -Force -ErrorAction "SilentlyContinue" | Out-Null -$LogFile = $LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftTeams$($App.Version).log" -replace " ", "" -$params = @{ - FilePath = "$Env:SystemRoot\System32\msiexec.exe" - ArgumentList = "/package $($OutFile.FullName) OPTIONS=`"noAutoStart=true`" ALLUSER=1 ALLUSERS=1 /quiet /log $LogFile" - NoNewWindow = $true - Wait = $true - PassThru = $true - ErrorAction = "Stop" -} -Start-Process @params -#endregion - -#region Optimise Teams for multi-session without GPU support -# Delete the registry auto-start -reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" /v "Teams" /f | Out-Null - -# Disable GPU acceleration by default by updating the default profile -$DesktopSetupJson = @" -{ - "appPreferenceSettings": { - "runningOnClose": true, - "disableGpu": true, - "callingMWEnabledPreferenceKey": false - }, - "theme": "default", - "currentWebLanguage": "$Language" -} -"@ -New-Item -Path "$Env:SystemDrive\Users\Default\AppData\Roaming\Microsoft\Teams" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -$FilePath = "$Env:SystemDrive\Users\Default\AppData\Roaming\Microsoft\Teams\desktop-config.json" -$Utf8NoBomEncoding = New-Object -TypeName "System.Text.UTF8Encoding" -ArgumentList $false -[System.IO.File]::WriteAllLines($FilePath, $DesktopSetupJson, $Utf8NoBomEncoding) -#endregion diff --git a/scripts/image/210_MicrosoftPowerToys.ps1 b/scripts/image/210_MicrosoftPowerToys.ps1 index 7702373..35070f0 100644 --- a/scripts/image/210_MicrosoftPowerToys.ps1 +++ b/scripts/image/210_MicrosoftPowerToys.ps1 @@ -21,13 +21,13 @@ The download path for Microsoft PowerToys. The default path is "$Env:SystemDrive #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftPowerToys" | Where-Object { $_.Architecture -eq "x64" -and $_.InstallerType -eq "Default" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftPowerToys$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftPowerToys$($App.Version).log" -replace " ", "" $params = @{ FilePath = $OutFile.FullName ArgumentList = "-silent -log $LogFile" diff --git a/scripts/image/211_MicrosoftVisualStudioCode.ps1 b/scripts/image/211_MicrosoftVisualStudioCode.ps1 index 321db0b..261f29d 100644 --- a/scripts/image/211_MicrosoftVisualStudioCode.ps1 +++ b/scripts/image/211_MicrosoftVisualStudioCode.ps1 @@ -10,7 +10,7 @@ The download path for Microsoft Visual Studio Code. The default path is "$Env:Sy .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file in "$Env:ProgramData\Nerdio\Logs" to track the installation progress. +- The script creates a log file in "$Env:SystemRoot\Logs\ImageBuild" to track the installation progress. - The script stops any running instances of Microsoft Visual Studio Code before installing the new version. #> @@ -22,14 +22,14 @@ The download path for Microsoft Visual Studio Code. The default path is "$Env:Sy #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftVisualStudioCode" | ` Where-Object { $_.Architecture -eq "x64" -and $_.Platform -eq "win32-x64" -and $_.Channel -eq "Stable" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftVisualStudioCode$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftVisualStudioCode$($App.Version).log" -replace " ", "" $params = @{ FilePath = $OutFile.FullName ArgumentList = "/VERYSILENT /NOCLOSEAPPLICATIONS /NORESTARTAPPLICATIONS /NORESTART /SP- /SUPPRESSMSGBOXES /MERGETASKS=!runcode /LOG=$LogFile" diff --git a/scripts/image/212_MicrosoftSQLServerManagementStudio.ps1 b/scripts/image/212_MicrosoftSQLServerManagementStudio.ps1 index d7ccc74..a5d05e6 100644 --- a/scripts/image/212_MicrosoftSQLServerManagementStudio.ps1 +++ b/scripts/image/212_MicrosoftSQLServerManagementStudio.ps1 @@ -11,7 +11,7 @@ Specifies the download path for SSMS. The default path is "$Env:SystemDrive\Apps .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file in "$Env:ProgramData\Nerdio\Logs" to track the installation progress. +- The script creates a log file in "$Env:SystemRoot\Logs\ImageBuild" to track the installation progress. - The script supports multiple languages, but it only installs the English version of SSMS. - The installation is performed silently without any user interaction. - The script checks if SSMS is already installed and skips the installation if it is. @@ -26,14 +26,14 @@ Specifies the download path for SSMS. The default path is "$Env:SystemDrive\Apps #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftSsms" | ` Where-Object { $_.Language -eq "English" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftSQLServerManagementStudio$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftSQLServerManagementStudio$($App.Version).log" -replace " ", "" $params = @{ FilePath = $OutFile.FullName ArgumentList = "/install /quiet /norestart DoNotInstallAzureDataStudio=1 /log $LogFile" diff --git a/scripts/image/213_MicrosoftAzureVirtualDesktopClient.ps1 b/scripts/image/213_MicrosoftAzureVirtualDesktopClient.ps1 index 272343d..fa7c704 100644 --- a/scripts/image/213_MicrosoftAzureVirtualDesktopClient.ps1 +++ b/scripts/image/213_MicrosoftAzureVirtualDesktopClient.ps1 @@ -12,7 +12,7 @@ The default path is "$Env:SystemDrive\Apps\Microsoft\Avd". .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file in "$Env:ProgramData\Nerdio\Logs" to track the installation progress. +- The script creates a log file in "$Env:SystemRoot\Logs\ImageBuild" to track the installation progress. - The script only installs the x64 version of the client from the "Public" channel. - The installation is performed silently without creating a desktop shortcut. #> @@ -25,14 +25,14 @@ The default path is "$Env:SystemDrive\Apps\Microsoft\Avd". #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftWvdRemoteDesktop" | ` Where-Object { $_.Architecture -eq "x64" -and $_.Channel -eq "Public" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftAvdClient$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftAvdClient$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /norestart DONOTCREATEDESKTOPSHORTCUT=true /log $LogFile" diff --git a/scripts/image/214_MicrosoftAzureCLI.ps1 b/scripts/image/214_MicrosoftAzureCLI.ps1 index 859003e..e8c229c 100644 --- a/scripts/image/214_MicrosoftAzureCLI.ps1 +++ b/scripts/image/214_MicrosoftAzureCLI.ps1 @@ -12,7 +12,7 @@ Specifies the download path for Microsoft Azure CLI. The default path is "$Env:S .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file in "$Env:ProgramData\Nerdio\Logs" directory to track the installation progress and any errors that occur during the installation. +- The script creates a log file in "$Env:SystemRoot\Logs\ImageBuild" directory to track the installation progress and any errors that occur during the installation. - The script uses the Start-Process cmdlet to execute the MSI package installation silently. #> @@ -24,14 +24,14 @@ Specifies the download path for Microsoft Azure CLI. The default path is "$Env:S #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftAzureCLI" | ` Where-Object { $_.Type -eq "msi" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftAvdCli$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftAvdCli$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /norestart ALLUSERS=1 /log $LogFile" diff --git a/scripts/image/215_MicrosoftPowerShell.ps1 b/scripts/image/215_MicrosoftPowerShell.ps1 index 3d1c2b8..8df6bac 100644 --- a/scripts/image/215_MicrosoftPowerShell.ps1 +++ b/scripts/image/215_MicrosoftPowerShell.ps1 @@ -16,7 +16,7 @@ This example runs the script to install the latest Microsoft PowerShell. .NOTES - Requires the Evergreen module. - Only installs the x64 architecture of Microsoft PowerShell. -- The installation log is saved in "$Env:ProgramData\Nerdio\Logs". +- The installation log is saved in "$Env:SystemRoot\Logs\ImageBuild". #> #description: Installs the latest Microsoft PowerShell @@ -27,7 +27,7 @@ This example runs the script to install the latest Microsoft PowerShell. #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MicrosoftPowerShell" | ` @@ -35,7 +35,7 @@ $App = Get-EvergreenApp -Name "MicrosoftPowerShell" | ` Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftPowerShell$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MicrosoftPowerShell$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /norestart ALLUSERS=1 /log $LogFile" diff --git a/scripts/image/400_AdobeAcrobatReaderDC.ps1 b/scripts/image/400_AdobeAcrobatReaderDC.ps1 index 80b0533..b9be4fa 100644 --- a/scripts/image/400_AdobeAcrobatReaderDC.ps1 +++ b/scripts/image/400_AdobeAcrobatReaderDC.ps1 @@ -27,7 +27,7 @@ The path where Adobe Acrobat Reader will be downloaded. The default path is "$En #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null #region Use Secure variables in Nerdio Manager to pass a JSON file with the variables list if ([System.String]::IsNullOrEmpty($SecureVars.VariablesList)) { @@ -60,7 +60,7 @@ $App = Get-EvergreenApp -Name "AdobeAcrobatReaderDC" | ` $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" # Install Adobe Acrobat Reader -$LogFile = "$Env:ProgramData\Nerdio\Logs\AdobeAcrobatReaderDC$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\AdobeAcrobatReaderDC$($App.Version).log" -replace " ", "" $Options = "EULA_ACCEPT=YES ENABLE_CHROMEEXT=0 DISABLE_BROWSER_INTEGRATION=1 diff --git a/scripts/image/401_FoxitPDFReader.ps1 b/scripts/image/401_FoxitPDFReader.ps1 index fae03cf..d3c1dbc 100644 --- a/scripts/image/401_FoxitPDFReader.ps1 +++ b/scripts/image/401_FoxitPDFReader.ps1 @@ -15,7 +15,7 @@ The target folder where Foxit PDF Reader will be downloaded. The default value i - This script requires the Evergreen module to be installed. - The script uses secure variables in Nerdio Manager to pass a JSON file with the variables list. If the secure variables are not available, the script defaults to the English language. - The script requires TLS 1.2 to be enabled on the system. -- The script creates a log file in the "$Env:ProgramData\Nerdio\Logs" folder with the name "FoxitPDFReader.log". +- The script creates a log file in the "$Env:SystemRoot\Logs\ImageBuild" folder with the name "FoxitPDFReader.log". - The script disables the "FoxitReaderUpdateService" service to prevent automatic updates. #> @@ -44,13 +44,13 @@ else { #region Script logic # Create target folder New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "FoxitReader" | Where-Object { $_.Language -eq $Language } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\FoxitPDFReader$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\FoxitPDFReader$($App.Version).log" -replace " ", "" $Options = "AUTO_UPDATE=0 NOTINSTALLUPDATE=1 MAKEDEFAULT=0 diff --git a/scripts/image/402_ZoomMeetings.ps1 b/scripts/image/402_ZoomMeetings.ps1 index ef62656..00c705b 100644 --- a/scripts/image/402_ZoomMeetings.ps1 +++ b/scripts/image/402_ZoomMeetings.ps1 @@ -10,7 +10,7 @@ The path where the Zoom Meetings VDI client will be downloaded. The default path .NOTES - This script requires the Evergreen module to be installed. -- The script creates a log file at "$Env:ProgramData\Nerdio\Logs\ZoomMeetings.log" to track the installation progress. +- The script creates a log file at "$Env:SystemRoot\Logs\ImageBuild\ZoomMeetings.log" to track the installation progress. - The script uses the Start-Process cmdlet to execute msiexec.exe with the necessary arguments for silent installation. #> @@ -22,14 +22,14 @@ The path where the Zoom Meetings VDI client will be downloaded. The default path #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download Zoom Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "ZoomVDI" | Where-Object { $_.Platform -eq "VDIClient" -and $_.Architecture -eq "x64" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\ZoomMeetings$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\ZoomMeetings$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" zSilentStart=false zNoDesktopShortCut=true ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/403_GoogleChrome.ps1 b/scripts/image/403_GoogleChrome.ps1 index 69cd983..ecabcac 100644 --- a/scripts/image/403_GoogleChrome.ps1 +++ b/scripts/image/403_GoogleChrome.ps1 @@ -26,13 +26,13 @@ Specifies the download path for Google Chrome. The default path is "$Env:SystemD #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "GoogleChrome" | Where-Object { $_.Architecture -eq "x64" -and $_.Channel -eq "stable" -and $_.Type -eq "msi" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\GoogleChrome$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\GoogleChrome$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/404_NotepadPlusPlus.ps1 b/scripts/image/404_NotepadPlusPlus.ps1 index a2f8903..cc63f43 100644 --- a/scripts/image/404_NotepadPlusPlus.ps1 +++ b/scripts/image/404_NotepadPlusPlus.ps1 @@ -11,7 +11,7 @@ Specifies the download path for Notepad++. The default path is "$Env:SystemDrive .NOTES - This script requires the "Evergreen" module. - The script will create a directory at the specified installation path if it does not already exist. -- The script will create a directory at "$Env:ProgramData\Nerdio\Logs" if it does not already exist. +- The script will create a directory at "$Env:SystemRoot\Logs\ImageBuild" if it does not already exist. - The script will download the latest version of Notepad++ from the Evergreen repository and install it silently. - The script will disable the automatic update feature of Notepad++ by renaming the updater folder. #> @@ -24,7 +24,7 @@ Specifies the download path for Notepad++. The default path is "$Env:SystemDrive #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "NotepadPlusPlus" | Where-Object { $_.Architecture -eq "x64" -and $_.Type -eq "exe" } | Select-Object -First 1 diff --git a/scripts/image/406_VLCMediaPlayer.ps1 b/scripts/image/406_VLCMediaPlayer.ps1 index 1d70040..15a4553 100644 --- a/scripts/image/406_VLCMediaPlayer.ps1 +++ b/scripts/image/406_VLCMediaPlayer.ps1 @@ -25,13 +25,13 @@ The download path for VLC media player. The default path is "$Env:SystemDrive\Ap #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "VideoLanVlcPlayer" | Where-Object { $_.Architecture -eq "x64" -and $_.Type -eq "MSI" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\VlcMediaPlayer$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\VlcMediaPlayer$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/407_7Zip.ps1 b/scripts/image/407_7Zip.ps1 index e4f451b..d65edf3 100644 --- a/scripts/image/407_7Zip.ps1 +++ b/scripts/image/407_7Zip.ps1 @@ -19,7 +19,7 @@ The download path for 7-Zip ZS. #region Script logic New-Item -Path $Path -ItemType "Directory" -Force | Out-Null -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force | Out-Null -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force | Out-Null -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force | Out-Null $App = Get-EvergreenApp -Name "7ZipZS" | Where-Object { $_.Architecture -eq "x64" } | Select-Object -First 1 diff --git a/scripts/image/408_RemoteDesktopAnalyzer.ps1 b/scripts/image/408_RemoteDesktopAnalyzer.ps1 index c5374f5..dbf8d5d 100644 --- a/scripts/image/408_RemoteDesktopAnalyzer.ps1 +++ b/scripts/image/408_RemoteDesktopAnalyzer.ps1 @@ -23,7 +23,7 @@ Specifies the path where the tools will be downloaded. The default path is 'C:\P #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force diff --git a/scripts/image/409_CiscoWebEx.ps1 b/scripts/image/409_CiscoWebEx.ps1 index f3315fd..5572c96 100644 --- a/scripts/image/409_CiscoWebEx.ps1 +++ b/scripts/image/409_CiscoWebEx.ps1 @@ -25,7 +25,7 @@ Specifies the download path for the Cisco WebEx VDI client. #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $App = [PSCustomObject]@{ Version = "43.4.0.25959" @@ -33,7 +33,7 @@ $App = [PSCustomObject]@{ } $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\CiscoWebEx$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\CiscoWebEx$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" ENABLEVDI=2 AUTOUPGRADEENABLED=0 ROAMINGENABLED=1 ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/410_ImageGlass.ps1 b/scripts/image/410_ImageGlass.ps1 index 5ec89f1..7242fed 100644 --- a/scripts/image/410_ImageGlass.ps1 +++ b/scripts/image/410_ImageGlass.ps1 @@ -24,13 +24,13 @@ The download path for ImageGlass. The default value is "$Env:SystemDrive\Apps\Im #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "ImageGlass" | Where-Object { $_.Architecture -eq "x64" -and $_.Type -eq "msi" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\ImageGlass$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\ImageGlass$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" RUNAPPLICATION=0 ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/411_draw.io.ps1 b/scripts/image/411_draw.io.ps1 index 5f54366..b7af4cd 100644 --- a/scripts/image/411_draw.io.ps1 +++ b/scripts/image/411_draw.io.ps1 @@ -12,7 +12,7 @@ The path where draw.io will be downloaded. The default path is "$Env:SystemDrive .NOTES - This script requires the Evergreen module to be installed. -- The script will create a log file in "$Env:ProgramData\Nerdio\Logs" to track the installation progress. +- The script will create a log file in "$Env:SystemRoot\Logs\ImageBuild" to track the installation progress. - The script will remove the draw.io shortcut from the desktop after installation. #> @@ -24,13 +24,13 @@ The path where draw.io will be downloaded. The default path is "$Env:SystemDrive #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "diagrams.net" | Where-Object { $_.Type -eq "msi" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\diagrams.net$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\diagrams.net$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" ALLUSERS=1 /quiet /log $LogFile" diff --git a/scripts/image/412_MozillaFirefox.ps1 b/scripts/image/412_MozillaFirefox.ps1 index 4a04ad9..3b99578 100644 --- a/scripts/image/412_MozillaFirefox.ps1 +++ b/scripts/image/412_MozillaFirefox.ps1 @@ -41,7 +41,7 @@ else { #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "MozillaFirefox" | ` @@ -49,7 +49,7 @@ $App = Get-EvergreenApp -Name "MozillaFirefox" | ` Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\MozillaFirefox$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\MozillaFirefox$($App.Version).log" -replace " ", "" $Options = "DESKTOP_SHORTCUT=false TASKBAR_SHORTCUT=false INSTALL_MAINTENANCE_SERVICE=false diff --git a/scripts/image/413_Paint.NET.ps1 b/scripts/image/413_Paint.NET.ps1 index 3973eac..d376e3c 100644 --- a/scripts/image/413_Paint.NET.ps1 +++ b/scripts/image/413_Paint.NET.ps1 @@ -24,7 +24,7 @@ The path where Paint.NET will be downloaded. The default value is "$Env:SystemDr #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "PaintDotNetOfflineInstaller" | ` @@ -40,7 +40,7 @@ $params = @{ Expand-Archive @params $Installer = Get-ChildItem -Path $Path -Include "paint*.msi" -Recurse -$LogFile = "$Env:ProgramData\Nerdio\Logs\Paint.NET$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\Paint.NET$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($Installer.FullName)`" DESKTOPSHORTCUT=0 CHECKFORUPDATES=0 CHECKFORBETAS=0 /quiet /log $LogFile" diff --git a/scripts/image/414_Greenshot.ps1 b/scripts/image/414_Greenshot.ps1 index dfd70cf..cc6b9da 100644 --- a/scripts/image/414_Greenshot.ps1 +++ b/scripts/image/414_Greenshot.ps1 @@ -29,13 +29,13 @@ The download path for Greenshot. The default value is "$Env:SystemDrive\Apps\Gre #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "Greenshot" | Where-Object { $_.Type -eq "exe" -and $_.InstallerType -eq "Default" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\Greenshot$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\Greenshot$($App.Version).log" -replace " ", "" $params = @{ FilePath = $OutFile.FullName ArgumentList = "/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /TASKS= /FORCECLOSEAPPLICATIONS /LOGCLOSEAPPLICATIONS /NORESTARTAPPLICATIONS /LOG=$LogFile" diff --git a/scripts/image/415_FoxitPDFEditor.ps1 b/scripts/image/415_FoxitPDFEditor.ps1 index 37ccf3b..8956b0e 100644 --- a/scripts/image/415_FoxitPDFEditor.ps1 +++ b/scripts/image/415_FoxitPDFEditor.ps1 @@ -40,13 +40,13 @@ else { #region Script logic # Create target folder New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "FoxitPDFEditor" | Where-Object { $_.Language -eq $Language } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" -$LogFile = "$Env:ProgramData\Nerdio\Logs\FoxitPDFEditor$($App.Version).log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\FoxitPDFEditor$($App.Version).log" -replace " ", "" $Options = "AUTO_UPDATE=0 NOTINSTALLUPDATE=1 MAKEDEFAULT=0 diff --git a/scripts/image/417_CitrixWorkspaceApp.ps1 b/scripts/image/417_CitrixWorkspaceApp.ps1 index 89e308d..ecfbce5 100644 --- a/scripts/image/417_CitrixWorkspaceApp.ps1 +++ b/scripts/image/417_CitrixWorkspaceApp.ps1 @@ -24,7 +24,7 @@ The path where the Citrix Workspace app will be download. The default path is "$ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force diff --git a/scripts/image/420_1Password.ps1 b/scripts/image/420_1Password.ps1 index fa84e52..73b045a 100644 --- a/scripts/image/420_1Password.ps1 +++ b/scripts/image/420_1Password.ps1 @@ -20,14 +20,14 @@ The download path for the 1Password client. The default path is "$Env:SystemDriv #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download $App = Get-EvergreenApp -Name "1Password" | Where-Object { $_.Type -eq "msi" } | Select-Object -First 1 $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "Stop" # Install package -$LogFile = "$Env:ProgramData\Nerdio\Logs\1Password.log" -replace " ", "" +$LogFile = "$Env:SystemRoot\Logs\ImageBuild\1Password.log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /log $LogFile" diff --git a/scripts/image/421_1PasswordCli.ps1 b/scripts/image/421_1PasswordCli.ps1 index 47a7261..24bbe57 100644 --- a/scripts/image/421_1PasswordCli.ps1 +++ b/scripts/image/421_1PasswordCli.ps1 @@ -29,7 +29,7 @@ The download path for the 1Password CLI. The default value is "$Env:ProgramFiles #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download - update when Evergreen supports 1Password CLI $App = Get-EvergreenApp -Name "1PasswordCLI" | Where-Object { $_.Architecture -eq "x64" } | Select-Object -First 1 diff --git a/scripts/image/999_CleanupImage.ps1 b/scripts/image/999_CleanupImage.ps1 index 97439c9..efe69b9 100644 --- a/scripts/image/999_CleanupImage.ps1 +++ b/scripts/image/999_CleanupImage.ps1 @@ -1,43 +1,101 @@ <# -.SYNOPSIS -This script is used to clean up an image by reenabling settings, removing application installers, -and removing logs older than 30 days post image completion. - -.DESCRIPTION -The script performs the following actions: -- Removes policies that prevent updates during deployment on Windows 10. -- Removes unnecessary paths in the image, such as "$Env:SystemDrive\Apps" and "$Env:SystemDrive\DeployAgent". -- Clears the Temp directory by removing all items and recreating the directory. -- Deletes logs older than 30 days from the "$Env:ProgramData\Nerdio\Logs" directory. -- Disables Windows Update by modifying the registry. - -.NOTES -- This script should be run with administrative privileges. -- The script is specifically designed for use in the Nerdio environment. -- Use caution when modifying the registry as it can have unintended consequences. + .SYNOPSIS + This script is used to clean up an image by removing unnecessary registry entries, + uninstalling specific applications, and removing unnecessary paths and items. + + .DESCRIPTION + The script performs the following tasks: + 1. Imports the Functions module + 2. Cleans up registry entries related to Windows Store policies + 3. Uninstalls a list of applications included in the image or that are not needed + 4. Removes specific paths from the image + 5. Removes items from the Temp directory #> -#description: Reenables settings, removes application installers, and remove logs older than 30 days post image completion -#execution mode: Combined -#tags: Image +#region Functions +function Get-InstalledSoftware { + [CmdletBinding()] + param () + $UninstallKeys = @( + "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", + "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" + ) + + $Apps = @() + foreach ($Key in $UninstallKeys) { + try { + $propertyNames = "DisplayName", "DisplayVersion", "Publisher", "UninstallString", "PSPath", "WindowsInstaller", "InstallDate", "InstallSource", "HelpLink", "Language", "EstimatedSize", "SystemComponent" + $Apps += Get-ItemProperty -Path $Key -Name $propertyNames -ErrorAction "SilentlyContinue" | ` + . { process { if ($null -ne $_.DisplayName) { $_ } } } | ` + Where-Object { $_.SystemComponent -ne 1 } | ` + Select-Object -Property @{n = "Name"; e = { $_.DisplayName } }, @{n = "Version"; e = { $_.DisplayVersion } }, "Publisher", "UninstallString", @{n = "RegistryPath"; e = { $_.PSPath -replace "Microsoft.PowerShell.Core\\Registry::", "" } }, "PSChildName", "WindowsInstaller", "InstallDate", "InstallSource", "HelpLink", "Language", "EstimatedSize" | ` + Sort-Object -Property "DisplayName", "Publisher" + } + catch { + throw $_.Exception.Message + } + } + + Remove-PSDrive -Name "HKU" -ErrorAction "SilentlyContinue" | Out-Null + return $Apps +} +#endregion +# Clean up registry entries if ((Get-CimInstance -ClassName "CIM_OperatingSystem").Caption -like "Microsoft Windows 1*") { # Remove policies + Write-LogFile -Message "Run: reg delete HKLM\Software\Policies\Microsoft\WindowsStore /v AutoDownload /f" -LogLevel 1 reg delete "HKLM\Software\Policies\Microsoft\WindowsStore" /v "AutoDownload" /f } +# Uninstall a list of applications already included in the image or that we don't need +# Microsoft .NET 6.x installs are in the default Windows Server image from the Azure Marketplace +$Targets = @("Microsoft .NET.*Windows Server Hosting", + "Microsoft .NET Runtime*", + "Microsoft ASP.NET Core*", + "Microsoft OLE DB Driver for SQL Server", + "Microsoft ODBC Driver 17 for SQL Server", + "Microsoft Windows Desktop Runtime - 8.0.6") +$Targets | ForEach-Object { + $Target = $_ + Get-InstalledSoftware | Where-Object { $_.Name -match $Target } | ForEach-Object { + + if ($_.UninstallString -match "msiexec") { + # Match the GUID in the uninstall string + $GuidMatches = [Regex]::Match($_.UninstallString, "({[A-Z0-9]{8}-([A-Z0-9]{4}-){3}[A-Z0-9]{12}})") + $params = @{ + FilePath = "$Env:SystemRoot\System32\msiexec.exe" + ArgumentList = "/uninstall $($GuidMatches.Value) /quiet /norestart" + NoNewWindow = $true + Wait = $true + ErrorAction = "Continue" + } + } + else { + # Split the uninstall string to grab the executable path + $UninstallStrings = $_.UninstallString -split "/" + $params = @{ + FilePath = $UninstallStrings[0] + ArgumentList = "/uninstall /quiet /norestart" + NoNewWindow = $true + Wait = $true + ErrorAction = "Continue" + } + } + + # Uninstall the application + Start-Process @params | Out-Null + } +} + # Remove paths that we should not need to leave around in the image -if (Test-Path -Path "$Env:SystemDrive\Apps") { Remove-Item -Path "$Env:SystemDrive\Apps" -Recurse -Force -ErrorAction "SilentlyContinue" } -if (Test-Path -Path "$Env:SystemDrive\DeployAgent") { Remove-Item -Path "$Env:SystemDrive\DeployAgent" -Recurse -Force -ErrorAction "SilentlyContinue" } +if (Test-Path -Path "$Env:SystemDrive\Apps") { + Remove-Item -Path "$Env:SystemDrive\Apps" -Recurse -Force -ErrorAction "SilentlyContinue" +} +if (Test-Path -Path "$Env:SystemDrive\DeployAgent") { + Remove-Item -Path "$Env:SystemDrive\DeployAgent" -Recurse -Force -ErrorAction "SilentlyContinue" +} # Remove items from the Temp directory (note that scripts run as SYSTEM) Remove-Item -Path $Env:Temp -Recurse -Force -Confirm:$false -ErrorAction "SilentlyContinue" New-Item -Path $Env:Temp -ItemType "Directory" -ErrorAction "SilentlyContinue" | Out-Null - -# Remove logs older than 30 days -Get-ChildItem -Path "$Env:ProgramData\Nerdio\Logs" -Include "*.*" -Recurse -ErrorAction "SilentlyContinue" | ` - Where-Object { ($_.LastWriteTime -lt (Get-Date).AddDays(-30)) -and ($_.psIsContainer -eq $false) } | ` - ForEach-Object { Remove-Item -Path $_.FullName -Force -Confirm:$false -ErrorAction "SilentlyContinue" } - -# Disable Windows Update -# reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f diff --git a/scripts/optimise/Install-CitrixOptimizer.ps1 b/scripts/optimise/Install-CitrixOptimizer.ps1 index 024c309..7c3311f 100644 --- a/scripts/optimise/Install-CitrixOptimizer.ps1 +++ b/scripts/optimise/Install-CitrixOptimizer.ps1 @@ -6,7 +6,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Get the Citrix Optimizer template switch -Regex ((Get-CimInstance -ClassName "CIM_OperatingSystem").Caption) { @@ -57,7 +57,7 @@ Push-Location -Path $OptimizerBin.Directory $params = @{ Source = $Template.FullName Mode = "Execute" - OutputLogFolder = "$Env:ProgramData\Nerdio\Logs" + OutputLogFolder = "$Env:SystemRoot\Logs\ImageBuild" OutputHtml = "$Env:SystemRoot\Temp\CitrixOptimizer.html" Verbose = $false } diff --git a/scripts/optimise/Install-MicrosoftVdot.ps1 b/scripts/optimise/Install-MicrosoftVdot.ps1 index 92900ff..2a3a8aa 100644 --- a/scripts/optimise/Install-MicrosoftVdot.ps1 +++ b/scripts/optimise/Install-MicrosoftVdot.ps1 @@ -6,7 +6,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download Microsoft Virtual Desktop Optimization Tool $App = Get-EvergreenApp -Name "MicrosoftVdot" | Select-Object -First 1 diff --git a/scripts/others/418_Synapse.ps1 b/scripts/others/418_Synapse.ps1 index 8a59873..7f34d04 100644 --- a/scripts/others/418_Synapse.ps1 +++ b/scripts/others/418_Synapse.ps1 @@ -5,7 +5,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download Synapse MSI, specify a secure variable named SynapseUrl to pass a custom URL $App = [PSCustomObject]@{ @@ -17,7 +17,7 @@ $OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -ErrorAction "S # Install the agent $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" - ArgumentList = "/package `"$OutFile.FullName`" /quiet /norestart /log `"$Env:ProgramData\Nerdio\Logs\Synapse.log`" ENABLE_UPDATE_NOTIFICATION=0 ISCHECKFORPRODUCTUPDATES=0" + ArgumentList = "/package `"$OutFile.FullName`" /quiet /norestart /log `"$Env:SystemRoot\Logs\ImageBuild\Synapse.log`" ENABLE_UPDATE_NOTIFICATION=0 ISCHECKFORPRODUCTUPDATES=0" NoNewWindow = $true Wait = $true PassThru = $true diff --git a/scripts/others/499_CrowdStrikeWindowsSensor.ps1 b/scripts/others/499_CrowdStrikeWindowsSensor.ps1 index c9ac5bb..bfdfa9d 100644 --- a/scripts/others/499_CrowdStrikeWindowsSensor.ps1 +++ b/scripts/others/499_CrowdStrikeWindowsSensor.ps1 @@ -6,7 +6,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Download CrowdStrike Windows Sensor, specify a secure variable named CrowdStrikeAgentUrl to pass a custom URL $App = [PSCustomObject]@{ @@ -18,7 +18,7 @@ New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -Erro # Install the agent $params = @{ FilePath = $OutFile.FullName - ArgumentList = "/install /quiet /norestart /log `"$Env:ProgramData\Nerdio\Logs\CrowdStrikeWindowsSensor.log`" CID=$($SecureVars.CrowdStrikeCID) VDI=1" # NO_START=1 + ArgumentList = "/install /quiet /norestart /log `"$Env:SystemRoot\Logs\ImageBuild\CrowdStrikeWindowsSensor.log`" CID=$($SecureVars.CrowdStrikeCID) VDI=1" # NO_START=1 NoNewWindow = $true Wait = $true PassThru = $true diff --git a/scripts/tweaks/Install-FSLogixAppMaskingRuleset.ps1 b/scripts/tweaks/Install-FSLogixAppMaskingRuleset.ps1 index efb7839..f6a7abd 100644 --- a/scripts/tweaks/Install-FSLogixAppMaskingRuleset.ps1 +++ b/scripts/tweaks/Install-FSLogixAppMaskingRuleset.ps1 @@ -5,7 +5,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $params = @{ Uri = $SecureVars.AppMaskingRuleset diff --git a/scripts/uninstall/Uninstall-7ZipZS.ps1 b/scripts/uninstall/Uninstall-7ZipZS.ps1 index 769ea0b..5c74a40 100644 --- a/scripts/uninstall/Uninstall-7ZipZS.ps1 +++ b/scripts/uninstall/Uninstall-7ZipZS.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Get-Process -ErrorAction "SilentlyContinue" | ` Where-Object { $_.Path -like "$Env:ProgramFiles\7-Zip-Zstandard\*" } | ` diff --git a/scripts/uninstall/Uninstall-AdobeAcrobat.ps1 b/scripts/uninstall/Uninstall-AdobeAcrobat.ps1 index 2731839..78a49fc 100644 --- a/scripts/uninstall/Uninstall-AdobeAcrobat.ps1 +++ b/scripts/uninstall/Uninstall-AdobeAcrobat.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Adobe Acrobat*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallAdobe$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallAdobe$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-CiscoWebEx.ps1 b/scripts/uninstall/Uninstall-CiscoWebEx.ps1 index 709aac7..b17e08b 100644 --- a/scripts/uninstall/Uninstall-CiscoWebEx.ps1 +++ b/scripts/uninstall/Uninstall-CiscoWebEx.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Webex*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallCiscoWebEx$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallCiscoWebEx$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-FoxitPDFEditor.ps1 b/scripts/uninstall/Uninstall-FoxitPDFEditor.ps1 index 77d28df..e6a3c1f 100644 --- a/scripts/uninstall/Uninstall-FoxitPDFEditor.ps1 +++ b/scripts/uninstall/Uninstall-FoxitPDFEditor.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Foxit PDF Editor*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallFoxitPDFEditor$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallFoxitPDFEditor$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-FoxitPDFReader.ps1 b/scripts/uninstall/Uninstall-FoxitPDFReader.ps1 index 1616c4f..fb76c86 100644 --- a/scripts/uninstall/Uninstall-FoxitPDFReader.ps1 +++ b/scripts/uninstall/Uninstall-FoxitPDFReader.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Foxit PDF Reader*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallFoxitPDFReader$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallFoxitPDFReader$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-GoogleChrome.ps1 b/scripts/uninstall/Uninstall-GoogleChrome.ps1 index 17d5dcc..02644fc 100644 --- a/scripts/uninstall/Uninstall-GoogleChrome.ps1 +++ b/scripts/uninstall/Uninstall-GoogleChrome.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Google Chrome*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallGoogleChrome$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallGoogleChrome$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-ImageGlass.ps1 b/scripts/uninstall/Uninstall-ImageGlass.ps1 index 026f3c2..3f3eacc 100644 --- a/scripts/uninstall/Uninstall-ImageGlass.ps1 +++ b/scripts/uninstall/Uninstall-ImageGlass.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "ImageGlass*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallImageGlass$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallImageGlass$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftAvdMsMmrHost.ps1 b/scripts/uninstall/Uninstall-MicrosoftAvdMsMmrHost.ps1 index 8b181da..aaba291 100644 --- a/scripts/uninstall/Uninstall-MicrosoftAvdMsMmrHost.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftAvdMsMmrHost.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "MsMmrHostMsi*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMsMmrHostMsi$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallMsMmrHostMsi$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftAvdWebRTC.ps1 b/scripts/uninstall/Uninstall-MicrosoftAvdWebRTC.ps1 index 0fc0f58..7431a9e 100644 --- a/scripts/uninstall/Uninstall-MicrosoftAvdWebRTC.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftAvdWebRTC.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Remote Desktop WebRTC Redirector Service*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallAvdWebRtc$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallAvdWebRtc$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftFSLogixApps.ps1 b/scripts/uninstall/Uninstall-MicrosoftFSLogixApps.ps1 index d8e626e..f6295f4 100644 --- a/scripts/uninstall/Uninstall-MicrosoftFSLogixApps.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftFSLogixApps.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null # Stop services Stop-Service -Name "frxsvc", "frxccds" -Force -ErrorAction "Ignore" @@ -41,7 +41,7 @@ Get-Process -ErrorAction "SilentlyContinue" | ` $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Microsoft FSLogix Apps*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoftFSLogixApps$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallMicrosoftFSLogixApps$($App.Version).log" -replace " ", "" $params = @{ FilePath = [Regex]::Match($App.UninstallString, '\"(.*)\"').Captures.Groups[1].Value ArgumentList = "/uninstall /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftNET.ps1 b/scripts/uninstall/Uninstall-MicrosoftNET.ps1 index a0dcff9..34c1f26 100644 --- a/scripts/uninstall/Uninstall-MicrosoftNET.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftNET.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Microsoft Windows Desktop Runtime*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoft.NET$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallMicrosoft.NET$($App.Version).log" -replace " ", "" $params = @{ FilePath = [Regex]::Match($App.UninstallString, '\"(.*)\"').Captures.Groups[1].Value ArgumentList = "/uninstall /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftOneDrive.ps1 b/scripts/uninstall/Uninstall-MicrosoftOneDrive.ps1 index 7adcd40..d232845 100644 --- a/scripts/uninstall/Uninstall-MicrosoftOneDrive.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftOneDrive.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Get-Process -ErrorAction "SilentlyContinue" | ` Where-Object { $_.Path -like "$Env:ProgramFiles\Microsoft OneDrive\*" } | ` diff --git a/scripts/uninstall/Uninstall-MicrosoftPowerToys.ps1 b/scripts/uninstall/Uninstall-MicrosoftPowerToys.ps1 index e37b8e6..efcb033 100644 --- a/scripts/uninstall/Uninstall-MicrosoftPowerToys.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftPowerToys.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "PowerToys*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoftPowerToys$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallMicrosoftPowerToys$($App.Version).log" -replace " ", "" $params = @{ FilePath = [Regex]::Match($App.UninstallString, '\"(.*)\"').Captures.Groups[1].Value ArgumentList = "/uninstall /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftTeams.ps1 b/scripts/uninstall/Uninstall-MicrosoftTeams.ps1 index b224718..dc759a8 100644 --- a/scripts/uninstall/Uninstall-MicrosoftTeams.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftTeams.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Teams Machine-Wide Installer*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallMicrosoftTeams$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallMicrosoftTeams$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-MicrosoftVisualStudioCode.ps1 b/scripts/uninstall/Uninstall-MicrosoftVisualStudioCode.ps1 index 295167f..f53a036 100644 --- a/scripts/uninstall/Uninstall-MicrosoftVisualStudioCode.ps1 +++ b/scripts/uninstall/Uninstall-MicrosoftVisualStudioCode.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Microsoft Visual Studio Code*" } foreach ($App in $Apps) { diff --git a/scripts/uninstall/Uninstall-MozillaFirefox.ps1 b/scripts/uninstall/Uninstall-MozillaFirefox.ps1 index 4ec0d21..73b1af5 100644 --- a/scripts/uninstall/Uninstall-MozillaFirefox.ps1 +++ b/scripts/uninstall/Uninstall-MozillaFirefox.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Mozilla Firefox*" } foreach ($App in $Apps) { diff --git a/scripts/uninstall/Uninstall-NotepadPlusPlus.ps1 b/scripts/uninstall/Uninstall-NotepadPlusPlus.ps1 index 611fef1..1f793dc 100644 --- a/scripts/uninstall/Uninstall-NotepadPlusPlus.ps1 +++ b/scripts/uninstall/Uninstall-NotepadPlusPlus.ps1 @@ -30,7 +30,7 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Notepad\+\+*" } foreach ($App in $Apps) { diff --git a/scripts/uninstall/Uninstall-Paint.NET.ps1 b/scripts/uninstall/Uninstall-Paint.NET.ps1 index 1d29471..05f616a 100644 --- a/scripts/uninstall/Uninstall-Paint.NET.ps1 +++ b/scripts/uninstall/Uninstall-Paint.NET.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Paint.NET*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallPaint.NET$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallPaint.NET$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-VLCMediaPlayer.ps1 b/scripts/uninstall/Uninstall-VLCMediaPlayer.ps1 index 3b72221..7a751ac 100644 --- a/scripts/uninstall/Uninstall-VLCMediaPlayer.ps1 +++ b/scripts/uninstall/Uninstall-VLCMediaPlayer.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "VLC media player*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallVlcMediaPlayer$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallVlcMediaPlayer$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-ZoomMeetings.ps1 b/scripts/uninstall/Uninstall-ZoomMeetings.ps1 index 61ae3ec..44deb87 100644 --- a/scripts/uninstall/Uninstall-ZoomMeetings.ps1 +++ b/scripts/uninstall/Uninstall-ZoomMeetings.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "Zoom*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallZoomMeetings$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallZoomMeetings$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-draw.io.ps1 b/scripts/uninstall/Uninstall-draw.io.ps1 index 743b8b7..1c793ef 100644 --- a/scripts/uninstall/Uninstall-draw.io.ps1 +++ b/scripts/uninstall/Uninstall-draw.io.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "draw.io*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\Uninstalldraw.io$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\Uninstalldraw.io$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/scripts/uninstall/Uninstall-pdfForgePDFCreator.ps1 b/scripts/uninstall/Uninstall-pdfForgePDFCreator.ps1 index 20874f7..275f995 100644 --- a/scripts/uninstall/Uninstall-pdfForgePDFCreator.ps1 +++ b/scripts/uninstall/Uninstall-pdfForgePDFCreator.ps1 @@ -30,11 +30,11 @@ function Get-InstalledSoftware { #endregion #region Script logic -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null $Apps = Get-InstalledSoftware | Where-Object { $_.Name -match "PDFCreator*" } foreach ($App in $Apps) { - $LogFile = "$Env:ProgramData\Nerdio\Logs\UninstallPDFCreator$($App.Version).log" -replace " ", "" + $LogFile = "$Env:SystemRoot\Logs\ImageBuild\UninstallPDFCreator$($App.Version).log" -replace " ", "" $params = @{ FilePath = "$Env:SystemRoot\System32\msiexec.exe" ArgumentList = "/uninstall `"$($App.PSChildName)`" /quiet /norestart /log $LogFile" diff --git a/support/405_pdfforgePDFCreator.ps1 b/support/405_pdfforgePDFCreator.ps1 index cf45533..e78b6b8 100644 --- a/support/405_pdfforgePDFCreator.ps1 +++ b/support/405_pdfforgePDFCreator.ps1 @@ -6,7 +6,7 @@ #region Script logic New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null -New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null +New-Item -Path "$Env:SystemRoot\Logs\ImageBuild" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null Import-Module -Name "Evergreen" -Force $App = Get-EvergreenApp -Name "PDFForgePDFCreator" | Select-Object -First 1 diff --git a/tests/scripts/3_RunImageScripts.Tests.ps1 b/tests/scripts/3_RunImageScripts.Tests.ps1 index 72d9f69..a75b9ee 100644 --- a/tests/scripts/3_RunImageScripts.Tests.ps1 +++ b/tests/scripts/3_RunImageScripts.Tests.ps1 @@ -131,5 +131,5 @@ AfterAll { # Copy logs for upload to the pipeline New-Item -Path "$Path\support\logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null - Copy-Item -Path "$Env:ProgramData\Nerdio\Logs\*" -Destination "$Path\support\logs" + Copy-Item -Path "$Env:SystemRoot\Logs\ImageBuild\*" -Destination "$Path\support\logs" } diff --git a/variables/NerdioManagerVariables.json b/variables/NerdioManagerVariables.json index 8ec2793..a0036bc 100644 --- a/variables/NerdioManagerVariables.json +++ b/variables/NerdioManagerVariables.json @@ -4,53 +4,19 @@ "OSLanguage": "en-AU", "TimeZone": "AUS Eastern Standard Time", "AppxMode": "Block", - "FSLogixAppMaskingRuleset": "https://stybluynyickph2.blob.core.windows.net/configs/AppMaskingRuleset.zip", - "FSLogixRedirections": "https://stybluynyickph2.blob.core.windows.net/configs/Redirections.xml", + "FSLogixAppMaskingRuleset": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/AppMaskingRuleset.zip", + "FSLogixRedirections": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/Redirections.xml", "Microsoft365AppsChannel": "Current", - "Microsoft365AppsConfig": "https://stybluynyickph2.blob.core.windows.net/configs/Microsoft365Apps-Validation.xml", + "Microsoft365AppsConfig": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/Microsoft365Apps-Outlook-Shared.xml", "FoxitLanguage": "English", "FirefoxLanguage": "en-US", "FirefoxChannel": "LATEST_FIREFOX_VERSION", "CitrixWorkspaceStream": "Current", - "CitrixOptimizer": "https://stybluynyickph2.blob.core.windows.net/binaries/CitrixOptimizerTool.zip", - "CitrixOptimizerTemplate": "https://stybluynyickph2.blob.core.windows.net/configs/CitrixOptimizer-Windows11-Lite.xml", - "AppLockerPolicyFile": "https://stybluynyickph2.blob.core.windows.net/configs/AppLockerRules-20231114-0803-Enforce.xml", - "GreenshotDefaultsIni": "https://stybluynyickph2.blob.core.windows.net/configs/greenshot-defaults.ini", + "CitrixOptimizer": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/binaries/CitrixOptimizerTool.zip", + "CitrixOptimizerTemplate": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/CitrixOptimizer-Windows11-Lite.xml", + "AppLockerPolicyFile": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/AppLockerRules-20231114-0803-Enforce.xml", + "GreenshotDefaultsIni": "https://stavdxwopw3ptwuo4o.blob.core.windows.net/configs/greenshot-defaults.ini", "AdobeAcrobatArchitecture": "x64", "AdobeAcrobatLanguage": "MUI" - }, - "westus": { - "Language": "en-US", - "OSLanguage": "en-US", - "TimeZone": "Pacific Standard Time", - "AppxMode": "Block", - "FSLogixAppMaskingRuleset": "https://stybluynyickph2.blob.core.windows.net/configs/AppMaskingRuleset.zip", - "FSLogixRedirections": "https://stybluynyickph2.blob.core.windows.net/configs/Redirections.xml", - "Microsoft365AppsChannel": "Current", - "Microsoft365AppsConfig": "https://stybluynyickph2.blob.core.windows.net/configs/Microsoft365Apps-Validation.xml", - "FoxitLanguage": "English", - "FirefoxLanguage": "en-US", - "CitrixWorkspaceStream": "Current", - "CitrixOptimizer": "https://stybluynyickph2.blob.core.windows.net/binaries/CitrixOptimizerTool.zip", - "CitrixOptimizerTemplate": "https://stybluynyickph2.blob.core.windows.net/configs/CitrixOptimizer-Windows11-Lite.xml", - "AppLockerPolicyFile": "https://stybluynyickph2.blob.core.windows.net/configs/AppLockerRules-20231114-0803-Enforce.xml", - "GreenshotDefaultsIni": "https://stybluynyickph2.blob.core.windows.net/configs/greenshot-defaults.ini" - }, - "uksouth": { - "Language": "en-GB", - "OSLanguage": "en-GB", - "TimeZone": "GMT Standard Time", - "AppxMode": "Block", - "FSLogixAppMaskingRuleset": "https://stybluynyickph2.blob.core.windows.net/configs/AppMaskingRuleset.zip", - "FSLogixRedirections": "https://stybluynyickph2.blob.core.windows.net/configs/Redirections.xml", - "Microsoft365AppsChannel": "Current", - "Microsoft365AppsConfig": "https://stybluynyickph2.blob.core.windows.net/configs/Microsoft365Apps-Validation.xml", - "FoxitLanguage": "English", - "FirefoxLanguage": "en-GB", - "CitrixWorkspaceStream": "Current", - "CitrixOptimizer": "https://stybluynyickph2.blob.core.windows.net/binaries/CitrixOptimizerTool.zip", - "CitrixOptimizerTemplate": "https://stybluynyickph2.blob.core.windows.net/configs/CitrixOptimizer-Windows11-Lite.xml", - "AppLockerPolicyFile": "https://stybluynyickph2.blob.core.windows.net/configs/AppLockerRules-20231114-0803-Enforce.xml", - "GreenshotDefaultsIni": "https://stybluynyickph2.blob.core.windows.net/configs/greenshot-defaults.ini" } } \ No newline at end of file