-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprep-environment.ps1
39 lines (31 loc) · 1.69 KB
/
prep-environment.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
write-output "download msix-toolkit"
invoke-webrequest -uri 'https://github.com/microsoft/MSIX-Toolkit/archive/refs/heads/master.zip' -out msix.zip
write-output "Expanding MSIX toolkit download"
Expand-Archive -Path .\msix.zip -DestinationPath . -Force
write-output "Creating Tools Directory"
New-Item -Type Directory -Name Tools
if ($env:PROCESSOR_ARCHITECTURE -eq 'AMD64')
{
Move-Item -Path .\MSIX-Toolkit-master\Redist.x64\* -Destination tools\ -Force
} else
{
Move-Item -Path .\MSIX-Toolkit-master\Redist.x86\* -Destination tools\ -Force
}
write-output "Cleaning up MSIX toolkit download"
remove-item -path msix-toolkit-master -Recurse -Force
write-output "downloading Package Support Framework"
#Install-Package -Name Microsoft.PackageSupportFramework -ProviderName NuGet -source 'https://www.nuget.org/api/v2' -scope CurrentUser
invoke-webrequest -uri 'https://www.nuget.org/api/v2/package/Microsoft.PackageSupportFramework/1.0.200410.1' -out package.zip
write-output "expanding Package Support Framework (with error supressing)"
expand-archive -path .\package.zip -ErrorAction SilentlyContinue
write-output "moving PSF to specific folder"
New-Item -Type Directory -Name Psf
Move-Item -Path .\package\bin\* -Destination PSF\ -Force
write-output "cleaning up Package Support Framework"
remove-item -path package -Recurse -Force
write-output "download msixmgr tool"
invoke-webrequest -uri 'https://aka.ms/msixmgr' -out msixmgr.zip
expand-archive -path .\msixmgr.zip
#set environment variable
$env:MsixTool = $(Get-Location).Path #to set for direct use
[Environment]::SetEnvironmentVariable('MsixTool', $((Get-Location).Path), [System.EnvironmentVariableTarget]::User)