From 5a849eba0b7164e799dd3b1ba7b786bcd79e75de Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 9 May 2022 18:18:02 +0200 Subject: [PATCH] Update Add-ScopeMachine.ps1 --- Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 b/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 index cea2c54..80b5968 100644 --- a/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 +++ b/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 @@ -1,8 +1,8 @@ #Function to configure prefered scope option as Machine -function Add-ScopeMachine ($path) { +function Add-ScopeMachine ($SettingsPath) { - if (Test-Path $path){ - $ConfigFile = Get-Content -Path $path | Where-Object {$_ -notmatch '//'} | ConvertFrom-Json + if (Test-Path $SettingsPath){ + $ConfigFile = Get-Content -Path $SettingsPath | Where-Object {$_ -notmatch '//'} | ConvertFrom-Json } if (!$ConfigFile){ $ConfigFile = @{} @@ -17,6 +17,6 @@ function Add-ScopeMachine ($path) { }) ) -Force } - $ConfigFile | ConvertTo-Json | Out-File $path -Encoding utf8 -Force + $ConfigFile | ConvertTo-Json | Out-File $SettingsPath -Encoding utf8 -Force } \ No newline at end of file