Compare commits
2 Commits
8e56d55a0b
...
bf39b4d00a
Author | SHA1 | Date | |
---|---|---|---|
bf39b4d00a | |||
f361e92ac8 |
@@ -24,6 +24,10 @@ Function Check-VCLibs {
|
|||||||
if ((Get-AppxPackage).Name -like "Microsoft.VCLibs.140.00.UWPDesktop" ) {return $true} else {return $false}
|
if ((Get-AppxPackage).Name -like "Microsoft.VCLibs.140.00.UWPDesktop" ) {return $true} else {return $false}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Check-MSXaml {
|
||||||
|
if ((Get-AppxPackage).Name -like "Microsoft.UI.Xaml*" ) {return $true} else {return $false}
|
||||||
|
}
|
||||||
|
|
||||||
Function Install-VCLibs {
|
Function Install-VCLibs {
|
||||||
if (Check-VCLibs) {
|
if (Check-VCLibs) {
|
||||||
Write-Output "VCLibs.UWPDesktop is already installed."
|
Write-Output "VCLibs.UWPDesktop is already installed."
|
||||||
@@ -38,6 +42,22 @@ Function Install-VCLibs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Install-MSXaml {
|
||||||
|
if (Check-MSXaml) {
|
||||||
|
Write-Output "Microsoft.UI.Xaml is already installed."
|
||||||
|
} else {
|
||||||
|
cmd.exe /c "curl -L -o c:\irnh\msuixaml.zip https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml"
|
||||||
|
try {
|
||||||
|
Expand-Archive c:\irnh\msuixaml.zip
|
||||||
|
Add-AppPackage .\msuixaml\tools\AppX\x64\Release\*.appx
|
||||||
|
Write-Output "Microsoft.UI.Xaml was installed."
|
||||||
|
} catch {
|
||||||
|
Write-Output "Microsoft.UI.Xaml could not be installed."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Function Install-WinGet {
|
Function Install-WinGet {
|
||||||
Write-Host "Checking latest version..."
|
Write-Host "Checking latest version..."
|
||||||
$WGLatestVer = (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).tag_name
|
$WGLatestVer = (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).tag_name
|
||||||
@@ -47,7 +67,7 @@ Function Install-WinGet {
|
|||||||
Write-Output "Domain Controllers has the latest version $WGDomainVer; using that."
|
Write-Output "Domain Controllers has the latest version $WGDomainVer; using that."
|
||||||
try {
|
try {
|
||||||
Add-AppxPackage -Path "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle"
|
Add-AppxPackage -Path "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle"
|
||||||
Add-AppxProvisionedPackage -Online -PackagePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle" -LicensePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\wingetlic.xml"
|
Add-AppxProvisionedPackage -Online -PackagePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle" -LicensePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\wingetlic.xml" -Verbose
|
||||||
Write-Output "WinGet was successfully installed."
|
Write-Output "WinGet was successfully installed."
|
||||||
} catch {
|
} catch {
|
||||||
Write-Output "WinGet could not be installed."
|
Write-Output "WinGet could not be installed."
|
||||||
@@ -56,17 +76,21 @@ Function Install-WinGet {
|
|||||||
else {
|
else {
|
||||||
# If the version we have on our domain controllers is NOT the latest, we have to get it online.
|
# If the version we have on our domain controllers is NOT the latest, we have to get it online.
|
||||||
Write-Host "Internet has the latest copy; downloading WinGet from Microsoft."
|
Write-Host "Internet has the latest copy; downloading WinGet from Microsoft."
|
||||||
cmd.exe /c "curl -L -o c:\irnh\winget.msixbundle https://aka.ms/getwinget" # I hate IWR. lol
|
# download latest files
|
||||||
# download latest lic file
|
|
||||||
foreach ($url in (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url){
|
foreach ($url in (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url){
|
||||||
if ($url -like "*.xml")
|
if ($url -like "*.xml")
|
||||||
{cmd.exe /c "curl -L -o c:\irnh\wingetlic.xml $url"} # I hate IWR. lol
|
{cmd.exe /c "curl -L -o c:\irnh\wingetlic.xml $url"} # I hate IWR. lol
|
||||||
|
if ($url -like "*.msixbundle")
|
||||||
|
{cmd.exe /c "curl -L -o c:\irnh\winget.msixbundle $url"} # I hate IWR. lol
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
# Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
# Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
||||||
Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
Add-AppxPackage -Path "c:\irnh\winget.msixbundle" -Verbose
|
||||||
Add-AppxProvisionedPackage -Online -PackagePath "c:\irnh\winget.msixbundle" -LicensePath "c:\irnh\wingetlic.xml"
|
Add-AppxProvisionedPackage -Online -PackagePath "c:\irnh\winget.msixbundle" -LicensePath "c:\irnh\wingetlic.xml" -Verbose
|
||||||
Write-Output "WinGet was successfully installed."
|
$winget = winget -v
|
||||||
|
if ($winget) {
|
||||||
|
Write-Output "WinGet was successfully installed."
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
Write-Output "WinGet could not be installed."
|
Write-Output "WinGet could not be installed."
|
||||||
}
|
}
|
||||||
@@ -77,6 +101,7 @@ Function Install-WinGet {
|
|||||||
|
|
||||||
if (!(Check-WinGet-Install)) {
|
if (!(Check-WinGet-Install)) {
|
||||||
Install-VCLibs
|
Install-VCLibs
|
||||||
|
Install-MSXaml
|
||||||
Install-WinGet
|
Install-WinGet
|
||||||
}
|
}
|
||||||
Stop-Transcript
|
Stop-Transcript
|
Reference in New Issue
Block a user