-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added windows configuration management assets
- Loading branch information
1 parent
c04441a
commit f771efe
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |