Skip to content

Instantly share code, notes, and snippets.

@thaddeusc1
Last active August 7, 2023 12:22
Show Gist options
  • Save thaddeusc1/eafcd6f55cd4c073aaeec833c139e4df to your computer and use it in GitHub Desktop.
Save thaddeusc1/eafcd6f55cd4c073aaeec833c139e4df to your computer and use it in GitHub Desktop.
Provision my commonly used apps for a new Windows 11 login
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Prerequsite
# ^^^^^^^^^^^
# Local scripts are allowed to run—e.g., `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
# See also: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2&WT.mc_id=email
$preinstalledMsStoreApps = "Spotify Music",
"OneNote for Windows 10",
"Office",
"Disney+",
"TikTok",
"Prime Video for Windows",
"Adobe Photoshop Express: Image Editor, Adjustments, Filters, Effects, Borders"
$msStoreApps = "Pandora",
"Diagnostic Data Viewer",
"Sysinternals Suite",
"iCloud",
"Microsoft Remote Desktop",
"Speedtest by Ookla",
"NanaZip"
# Currently, fonts can **not** be searched by name.
$msStoreFontIds = "9N9DZG1XT2MB", # Georgia Pro
"9NS5CT1MZ7M8", # Arial Nova
"9N8D67VHHDC2", # Verdana Pro
"9N57VDP26CD7", # Rockwell Nova
"9N1WR5ZSCT3R", # Convection
"9PK93BG0Z1JJ", # Gill Sans Nova
"9P21845V8Z53", # Nina
"9NPQGC3LCK31" # Ink Draft
$utilityAppIds = "REALiX.HWiNFO",
"CPUID.CPU-Z",
"TechPowerUp.GPU-Z",
#"Iterate.MountainDuck",
"Resplendence.LatencyMon",
"Microsoft.PowerToys"
$devAppIds = "Microsoft.VisualStudio.2022.Community"
$linuxDistroIds = "Canonical.Ubuntu",
"Canonical.Ubuntu.2004",
"Canonical.Ubuntu.1804",
"Canonical.Ubuntu.1604"
# WSL2?
$productivityAppIds = "Microsoft.VisualStudioCode",
"AgileBits.1Password",
"Git.Git"
$officeAppIds = "Microsoft.Office",
"Microsoft.Teams"
$gameAppIds = "Valve.Steam",
"GOG.Galaxy"
#"ElectronicArts.EADesktop",
#"Ubisoft.Connect",
#"Discord.Discord"
$foldingAppIds = "FoldingAtHome.FoldingAtHome",
"Google.Chrome"
foreach ($appName in $msStoreApps)
{
winget.exe install --name "$appName" --exact --source msstore --accept-package-agreements
}
foreach ($fontId in $msStoreFontIds)
{
winget.exe install --id "$fontId" --exact --source msstore --accept-package-agreements
}
foreach ($appId in $productivityAppIds + $utilityAppIds)
{
winget.exe install --id "$appId" --exact --source winget
}
if (!(Test-Path "${env:LOCALAPPDATA}\Programs"))
{
New-Item -ItemType Directory -Path "$env:LOCALAPPDATA" -Name Programs
}
New-Item -ItemType Junction -Path "$HOME" -Name Programs -Target "${env:LOCALAPPDATA}\Programs"
if (Test-Path "${env:LOCALAPPDATA}\AMD\Radeonsoftware")
{
New-Item -ItemType Directory -Path "${HOME}\Documents" -Name 'AMD software'
New-Item -ItemType Junction -Path "${HOME}\Documents\AMD software" -Name "Performance tuning profiles" -Target "${env:LOCALAPPDATA}\AMD\Radeonsoftware"
New-Item -ItemType Junction -Path "${HOME}\Documents\AMD software" -Name "Performance logs" -Target "${env:LOCALAPPDATA}\AMD\CN"
}
$appData = Get-ItemProperty -Path "${HOME}\AppData"
$appData.Attributes = $appData.Attributes -bAND (-bNOT [System.IO.FileAttributes]::Hidden)
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$errorPathTestFailed=1
# Prerequsite
# ^^^^^^^^^^^
# - iCloud Drive has completed initialization of the local "iCloud Drive" folder.
$iCloudHome="${HOME}\iCloudDrive"
if (!(Test-Path "$iCloudHome"))
{
echo "iCloud home directory path could not be accessed."
exit $errorPathTestFailed
}
$iCloudDownloads="${iCloudHome}\Downloads"
$localDownloads="${HOME}\Downloads"
$previewDir="${iCloudHome}\com~apple~Preview"
$picturesDir="${HOME}\Pictures"
Copy-Item "${previewDir}\notes.png" -Destination "$picturesDir"
Start-Process 'https://www.icloud.com/notes/'
Copy-Item "${previewDir}\reminders.png" -Destination "$picturesDir"
Start-Process 'https://www.icloud.com/reminders/'
Copy-Item "${previewDir}\pages.png" -Destination "$picturesDir"
Start-Process 'https://www.icloud.com/pages/'
Copy-Item "${previewDir}\numbers.png" -Destination "$picturesDir"
Start-Process 'https://www.icloud.com/numbers/'
Copy-Item "${previewDir}\keynote.png" -Destination "$picturesDir"
Start-Process 'https://www.icloud.com/keynote/'
Copy-Item "${iCloudDownloads}\HashTab_v6.0.0.34_Setup.exe" -Destination "$localDownloads"
Start-Process "${localDownloads}\HashTab_v6.0.0.34_Setup.exe" -Wait
Copy-Item "${iCloudDownloads}\iStatServerInstaller-3.0.9.msi" -Destination "$localDownloads"
Copy-Item "${iCloudDownloads}\openhardwaremonitor-v0.9.6.zip" -Destination "$localDownloads"
Start-Process -FilePath "${localDownloads}\iStatServerInstaller-3.0.9.msi" -ArgumentList "/passive" -Wait
Expand-Archive "${localDownloads}\openhardwaremonitor-v0.9.6.zip" -DestinationPath "$env:TEMP"
$iStatBin="${env:ProgramFiles(x86)}\iStat Server\bin"
$upgradeOpenHwMon="Stop-Service -Name iStatServerService;" +
"Copy-Item '${env:TEMP}\OpenHardwareMonitor\OpenHardwareMonitorLib.dll' -Destination '$iStatBin' -Force;" +
"Copy-Item '${env:TEMP}\OpenHardwareMonitor\License.html' -Destination '${iStatBin}\OpenHardwareMonitorLicense.html' -Force;" +
"Start-Service -Name iStatServerService"
Start-Process -FilePath "powershell.exe" -ArgumentList "-NonInteractive -Command `"& {$upgradeOpenHwMon}`"" -Verb RunAs -Wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment