File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,15 @@ function setenv($key, $value) {
228
228
}
229
229
230
230
function Get-TempEnv ($key ) {
231
- $path = Join-Path ( $ Env: TEMP ) " .ssh\ $ key.env "
231
+ $path = Get-TempEnvPath ( $ key)
232
232
if (Test-Path $path ) {
233
233
$value = Get-Content $path
234
234
[void ][Environment ]::SetEnvironmentVariable($key , $value , [EnvironmentVariableTarget ]::Process )
235
235
}
236
236
}
237
237
238
238
function Set-TempEnv ($key , $value ) {
239
- $path = Join-Path ( $ Env: TEMP ) " .ssh\ $ key.env "
239
+ $path = Get-TempEnvPath ( $ key)
240
240
if ($value -eq $null ) {
241
241
if (Test-Path $path ) {
242
242
Remove-Item $path
@@ -247,6 +247,11 @@ function Set-TempEnv($key, $value) {
247
247
}
248
248
}
249
249
250
+ function Get-TempEnvPath ($key ){
251
+ $path = Join-Path ([System.IO.Path ]::GetTempPath()) " .ssh\$key .env"
252
+ return $path
253
+ }
254
+
250
255
# Retrieve the current SSH agent PID (or zero). Can be used to determine if there
251
256
# is a running agent.
252
257
function Get-SshAgent () {
You can’t perform that action at this time.
0 commit comments