added server appx scripts

This commit is contained in:
Justin Donnelly
2021-09-21 12:02:19 -04:00
parent 974caaec2d
commit 6436898930
4 changed files with 106 additions and 0 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
qseow-dev.code-workspace
adusers.csv
.vs/VSWorkspaceState.json
.vs/qseow-scripts/project-colors.json
.vs/qseow-scripts/v17/.suo

BIN
.vs/slnx.sqlite Normal file

Binary file not shown.

72
appx-server22-prereq.ps1 Normal file
View File

@@ -0,0 +1,72 @@
# Install-VCLibs.140.00 Version 14.0.30035
# Andreas Nick 2021
$StoreLink = 'https://www.microsoft.com/de-de/p/app-installer/9nblggh4nns1'
$StorePackageName = 'Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe.appx'
$RepoName = 'AppPAckages'
$RepoLokation = $env:Temp
$Packagename = 'Microsoft.VCLibs.140.00'
$RepoPath = Join-Path $RepoLokation -ChildPath $RepoName
$RepoPath = Join-Path $RepoPath -ChildPath $Packagename
#
# Function Source
# Idea from: https://serverfault.com/questions/1018220/how-do-i-install-an-app-from-windows-store-using-powershell
# modificated version. Now able to filte and return msix url's
#
function Download-AppPackage {
[CmdletBinding()]
param (
[string]$Uri,
[string]$Filter = '.*' #Regex
)
process {
#$Uri=$StoreLink
$WebResponse = Invoke-WebRequest -UseBasicParsing -Method 'POST' -Uri 'https://store.rg-adguard.net/api/GetFiles' -Body "type=url&url=$Uri&ring=Retail" -ContentType 'application/x-www-form-urlencoded'
$result =$WebResponse.Links.outerHtml | Where-Object {($_ -like '*.appx*') -or ($_ -like '*.msix*')} | Where-Object {$_ -like '*_neutral_*' -or $_ -like "*_"+$env:PROCESSOR_ARCHITECTURE.Replace("AMD","X").Replace("IA","X")+"_*"} | ForEach-Object {
$result = "" | Select-Object -Property filename, downloadurl
if( $_ -match '(?<=rel="noreferrer">).+(?=</a>)' )
{
$result.filename = $matches.Values[0]
}
if( $_ -match '(?<=a href=").+(?=" r)' )
{
$result.downloadurl = $matches.Values[0]
}
$result
}
$result | Where-Object -Property filename -Match $filter
}
}
$package = Download-AppPackage -Uri $StoreLink -Filter $StorePackageName
if(-not (Test-Path $RepoPath ))
{
New-Item $RepoPath -ItemType Directory -Force
}
if(-not (Test-Path (Join-Path $RepoPath -ChildPath $package.filename )))
{
Invoke-WebRequest -Uri $($package.downloadurl) -OutFile (Join-Path $RepoPath -ChildPath $package.filename )
} else
{
Write-Information "The file $($package.filename) already exist in the repo. Skip download"
}
#Install the Runtime
add-AppPackage (Join-Path $RepoPath -ChildPath $package.filename )

31
install-winget-server.ps1 Normal file
View File

@@ -0,0 +1,31 @@
# Install-Winget Version v1.0.11692
# Andreas Nick 2021
# From github
$WinGet_Link = 'https://github.com/microsoft/winget-cli/releases/download/v1.0.11692/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
$WinGet_Name = 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
$RepoName = 'AppPAckages'
$RepoLokation = $env:Temp
$Packagename = 'Winget'
$RepoPath = Join-Path $RepoLokation -ChildPath $RepoName
$RepoPath = Join-Path $RepoPath -ChildPath $Packagename
if(-not (Test-Path $RepoPath ))
{
New-Item $RepoPath -ItemType Directory -Force
}
if(-not (Test-Path (Join-Path $RepoPath -ChildPath $WinGet_Name )))
{
Invoke-WebRequest -Uri $WinGet_Link -OutFile (Join-Path $RepoPath -ChildPath $WinGet_Name )
} else
{
Write-Information "The file $WinGet_Name already exist in the repo. Skip download"
}
#Install the Package
Add-AppPackage (Join-Path $RepoPath -ChildPath $WinGet_Name)