Skip to content

Commit

Permalink
Update Install-WinUtilWinget.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech committed Jul 27, 2023
1 parent 2c85691 commit 4b37bb4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions functions/private/Install-WinUtilWinget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Install-WinUtilWinget {
# Source: https://github.com/asheroto/winget-installer

#adding the code from the asheroto repo
Set-ExecutionPolicy RemoteSigned -force -ErrorAction SilentlyContinue
Set-ExecutionPolicy RemoteSigned -force
$apiLatestUrl = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
$tempFolder = $env:TEMP

Expand Down Expand Up @@ -107,7 +107,7 @@ function Install-WinUtilWinget {

foreach ($dependency in $dependencies) {
$dependency.file = $dependency.fileName
iwr $dependency.url -OutFile $dependency.file
Invoke-WebRequest $dependency.url -OutFile $dependency.file
}

$uiLibs.nupkg.file = $PSScriptRoot + '\' + $uiLibs.nupkg.fileName
Expand All @@ -119,10 +119,10 @@ function Install-WinUtilWinget {

Add-AppxPackage -Path $desktopAppInstaller.file -DependencyPath $vcLibsUwp.file,$uiLibs.uwp.file

rm $desktopAppInstaller.file
rm $vcLibsUwp.file
rm $uiLibs.nupkg.file
rm $uiLibs.uwp.file
Remove-Item $desktopAppInstaller.file
Remove-Item $vcLibsUwp.file
Remove-Item $uiLibs.nupkg.file
Remove-Item $uiLibs.uwp.file
Write-Host "WinGet installed!" -ForegroundColor Green
$ProgressPreference = $oldProgressPreference
Update-EnvironmentVariables
Expand Down

0 comments on commit 4b37bb4

Please sign in to comment.