Update Add-ScopeMachine.ps1

pull/75/head
Romain 2022-05-09 18:18:02 +02:00
parent 9f26fbfaa0
commit 5a849eba0b
1 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
#Function to configure prefered scope option as Machine #Function to configure prefered scope option as Machine
function Add-ScopeMachine ($path) { function Add-ScopeMachine ($SettingsPath) {
if (Test-Path $path){ if (Test-Path $SettingsPath){
$ConfigFile = Get-Content -Path $path | Where-Object {$_ -notmatch '//'} | ConvertFrom-Json $ConfigFile = Get-Content -Path $SettingsPath | Where-Object {$_ -notmatch '//'} | ConvertFrom-Json
} }
if (!$ConfigFile){ if (!$ConfigFile){
$ConfigFile = @{} $ConfigFile = @{}
@ -17,6 +17,6 @@ function Add-ScopeMachine ($path) {
}) })
) -Force ) -Force
} }
$ConfigFile | ConvertTo-Json | Out-File $path -Encoding utf8 -Force $ConfigFile | ConvertTo-Json | Out-File $SettingsPath -Encoding utf8 -Force
} }