diff --git a/SecretServer/Public/Get-SecretServerConfig.ps1 b/SecretServer/Public/Get-SecretServerConfig.ps1 index 90b7755..f5a0aaf 100644 --- a/SecretServer/Public/Get-SecretServerConfig.ps1 +++ b/SecretServer/Public/Get-SecretServerConfig.ps1 @@ -14,18 +14,18 @@ [ValidateSet("Variable","ConfigFile")]$Source = "Variable" ) - if(-not (Test-Path -Path "$PSScriptRoot\SecretServer_$($env:USERNAME).xml" -ErrorAction SilentlyContinue)) { + if(-not (Test-Path -Path "$PSScriptRoot\..\SecretServer.xml" -ErrorAction SilentlyContinue)) { try { - Write-Verbose "Did not find config file $PSScriptRoot\SecretServer_$($env:USERNAME).xml attempting to create" + Write-Verbose "Did not find config file $PSScriptRoot\..\SecretServer.xml attempting to create" [pscustomobject]@{ Uri = $null Token = $null ServerInstance = $null Database = $null - } | Export-Clixml -Path "$PSScriptRoot\SecretServer_$($env:USERNAME).xml" -Force -ErrorAction Stop + } | Export-Clixml -Path "$PSScriptRoot\..\SecretServer.xml" -Force -ErrorAction Stop } catch { - Write-Warning "Failed to create config file $PSScriptRoot\SecretServer_$($env:USERNAME).xml: $_" + Write-Warning "Failed to create config file $PSScriptRoot\..\SecretServer.xml: $_" } } @@ -33,7 +33,7 @@ $SecretServerConfig } else { - Import-Clixml -Path "$PSScriptRoot\SecretServer_$($env:USERNAME).xml" + Import-Clixml -Path "$PSScriptRoot\..\SecretServer.xml" } } diff --git a/SecretServer/Public/Set-SecretServerConfig.ps1 b/SecretServer/Public/Set-SecretServerConfig.ps1 index 0255e7e..bb1031e 100644 --- a/SecretServer/Public/Set-SecretServerConfig.ps1 +++ b/SecretServer/Public/Set-SecretServerConfig.ps1 @@ -63,7 +63,7 @@ #Write the global variable and the xml $Global:SecretServerConfig = $Existing - $Existing | Select -Property * -ExcludeProperty Proxy | Export-Clixml -Path "$PSScriptRoot\SecretServer_$($env:USERNAME).xml" -Force + $Existing | Select -Property * -ExcludeProperty Proxy | Export-Clixml -Path "$PSScriptRoot\..\SecretServer.xml" -Force } #publish