Skip to content

Commit 3d5ba3e

Browse files
committed
fix
1 parent 2d71cd6 commit 3d5ba3e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

integrationtests/smb_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ func randomString(length int) string {
3030
}
3131

3232
func setupUser(username, password string) error {
33-
cmdLine := fmt.Sprintf(`set "PSModulePath="` +
34-
`;Import-Module Microsoft.PowerShell.Security -RequiredVersion 3.0.0.0` +
35-
`;$PWord = ConvertTo-SecureString $Env:password -AsPlainText -Force` +
33+
cmdLine := fmt.Sprintf(`$PWord = ConvertTo-SecureString $Env:password -AsPlainText -Force` +
3634
`;New-Localuser -name $Env:username -accountneverexpires -password $PWord`)
3735
cmd := exec.Command("powershell", "/c", cmdLine)
3836
cmd.Env = append(os.Environ(),
3937
fmt.Sprintf("username=%s", username),
40-
fmt.Sprintf("password=%s", password))
38+
fmt.Sprintf("password=%s", password),
39+
"PSModulePath=") // Set the PSModulePath environment variable
4140
if output, err := cmd.CombinedOutput(); err != nil {
4241
return fmt.Errorf("setupUser failed: %v, output: %q", err, string(output))
4342
}

0 commit comments

Comments
 (0)