diff --git a/profile.ps1 b/profile.ps1 index 31b51de..7af0474 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -142,7 +142,7 @@ function wsh { if (!($session = Get-PSSession -ComputerName $ComputerName -Name 'wsh*' -ErrorAction SilentlyContinue | Where-Object Availability -eq 'Available' | Select-Object -First 1)) { $session = New-PSSession -ComputerName $ComputerName -Name ('wsh'+(Get-Random)) Invoke-Command -Session $session -Command $scriptBlock - Invoke-Command -Session $session -Command {Set-Location ~} + Invoke-Command -Session $session -Command {Set-Location $env:USERPROFILE} } Enter-PSSession $session }