@@ -481,7 +481,7 @@ func (m *ActivationManager) generatePowerShellScript(config ActivationConfig) (*
481481 shimsDir = filepath .FromSlash (shimsDir )
482482 }
483483 sb .WriteString (fmt .Sprintf ("$shimsDir = \" %s\" \n " , shimsDir ))
484- sb .WriteString ("$env:PATH = \" $shimsDir; \" + (($env:PATH -split '; ') | Where-Object { $_ -ne $shimsDir } -join '; ')\n " )
484+ sb .WriteString (fmt . Sprintf ( "$env:PATH = \" $shimsDir%c \" + (($env:PATH -split '%c ') | Where-Object { $_ -ne $shimsDir } -join '%c ')\n " , os . PathListSeparator , os . PathListSeparator , os . PathListSeparator ) )
485485 sb .WriteString ("\n " )
486486 } else if len (config .InjectedPaths ) > 0 {
487487 // PATH mode activation
@@ -494,10 +494,10 @@ func (m *ActivationManager) generatePowerShellScript(config ActivationConfig) (*
494494 }
495495 paths = append (paths , path )
496496 }
497- injectedPath := strings .Join (paths , ";" )
498- sb .WriteString (fmt .Sprintf ("$unirtmPaths = \" %s\" -split '; '\n " , injectedPath ))
499- sb .WriteString ("$env:UNIRTM_PATH = $unirtmPaths -join '; '\n " )
500- sb .WriteString ("$env:PATH = ($env:UNIRTM_PATH + '; ' + (($env:PATH -split '; ') | Where-Object { $unirtmPaths -notcontains $_ } -join '; '))\n " )
497+ injectedPath := strings .Join (paths , string ( os . PathListSeparator ) )
498+ sb .WriteString (fmt .Sprintf ("$unirtmPaths = \" %s\" -split '%c '\n " , injectedPath , os . PathListSeparator ))
499+ sb .WriteString (fmt . Sprintf ( "$env:UNIRTM_PATH = $unirtmPaths -join '%c '\n " , os . PathListSeparator ) )
500+ sb .WriteString (fmt . Sprintf ( "$env:PATH = ($env:UNIRTM_PATH + '%c ' + (($env:PATH -split '%c ') | Where-Object { $unirtmPaths -notcontains $_ } -join '%c '))\n " , os . PathListSeparator , os . PathListSeparator , os . PathListSeparator ) )
501501 sb .WriteString ("\n " )
502502 }
503503
0 commit comments