Skip to content

Commit

Permalink
Added windows configuration management assets
Browse files Browse the repository at this point in the history
  • Loading branch information
BIGboss248 committed Oct 30, 2024
1 parent c04441a commit f771efe
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
8 changes: 8 additions & 0 deletions windows configuration/assets/download_install_winget.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$progressPreference = 'silentlyContinue'
Write-Information "Downloading WinGet and its dependencies..."
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
67 changes: 67 additions & 0 deletions windows configuration/assets/provisioning.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Update winget
Get-ChildItem "$($env:ProgramData)\provisioning\Microsoft.VCLibs.x64.*",
"$($env:ProgramData)\provisioning\Microsoft.UI.Xaml.*",
"$($env:ProgramData)\provisioning\Microsoft.DesktopAppInstaller_*" | %{
"Updating $($_.Name)" | Out-Host
Add-AppxPackage $_.FullName -ErrorAction SilentlyContinue
}

# Wait for network
do{
$ping = Test-NetConnection '8.8.8.8' -InformationLevel Quiet
if(!$ping){
Clear-Host
'Wainting for network connection' | Out-Host
Start-Sleep -s 5
}
} while(!$ping)

# Scope user or machine
$scope = 'machine'

$packages =
[PSCustomObject]@{
Name = "Adobe.Acrobat.Reader.64-bit"
Scope = $scope
},
[PSCustomObject]@{
Name = "Microsoft.Teams.Classic"
Scope = $scope
},
[PSCustomObject]@{
Name = "Google.Chrome"
Scope = $scope
},
[PSCustomObject]@{
Name = "7zip.7zip"
Scope = $scope
},
[PSCustomObject]@{
Name = "Mozilla.Firefox"
Scope = $scope
},
[PSCustomObject]@{
Name = "Zoom.Zoom"
Scope = $scope
},
[PSCustomObject]@{
Name = "Microsoft.VisualStudioCode"
Scope = $scope
},
[PSCustomObject]@{
Name = "VideoLAN.VLC"
Scope = $null
}

$packages | % {
if ($_.Scope) {
winget install -e --id $_.Name --scope 'machine' --silent --accept-source-agreements
}
else {
winget install -e --id $_.Name --silent --accept-source-agreements
}
}


Write-Host "All Done!" -ForegroundColor Green
Read-Host
9 changes: 9 additions & 0 deletions windows configuration/assets/setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$provisioning = "$($env:ProgramData)\provisioning"

New-Item $provisioning -ItemType Directory -Force | Out-Null

Get-ChildItem | ?{$_.name -ne "setup.ps1"} | %{
Copy-Item $_.FullName "$($provisioning)\$($_.name)" -Force
}

New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "execute_provisioning" -Value ("cmd /c powershell.exe -ExecutionPolicy Bypass -File {0}\provisioning.ps1" -f $provisioning)

0 comments on commit f771efe

Please sign in to comment.