@@ -24,7 +24,6 @@ import (
24
24
"fmt"
25
25
"os"
26
26
"os/exec"
27
- "runtime"
28
27
"testing"
29
28
30
29
"github.com/Azure/azure-storage-azcopy/v10/common"
@@ -111,9 +110,6 @@ func TestBasic_PSAuth(t *testing.T) {
111
110
recursive : true ,
112
111
}, & hooks {
113
112
beforeTestRun : func (h hookHelper ) {
114
- if runtime .GOOS != "windows" {
115
- h .SkipTest ()
116
- }
117
113
tenId , appId , clientSecret := GlobalInputManager {}.GetServicePrincipalAuth ()
118
114
cmd := `$secret = ConvertTo-SecureString -String %s -AsPlainText -Force;
119
115
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList %s, $secret;
@@ -123,7 +119,7 @@ func TestBasic_PSAuth(t *testing.T) {
123
119
}
124
120
125
121
script := fmt .Sprintf (cmd , clientSecret , appId )
126
- out , err := exec .Command ("powershell " , script ).Output ()
122
+ out , err := exec .Command ("pwsh" , "-Command " , script ).Output ()
127
123
if err != nil {
128
124
e := err .(* exec.ExitError )
129
125
t .Logf (string (e .Stderr ))
@@ -149,9 +145,6 @@ func TestBasic_PSAuthCamelCase(t *testing.T) {
149
145
recursive : true ,
150
146
}, & hooks {
151
147
beforeTestRun : func (h hookHelper ) {
152
- if runtime .GOOS != "windows" {
153
- h .SkipTest ()
154
- }
155
148
tenId , appId , clientSecret := GlobalInputManager {}.GetServicePrincipalAuth ()
156
149
cmd := `$secret = ConvertTo-SecureString -String %s -AsPlainText -Force;
157
150
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList %s, $secret;
@@ -161,7 +154,7 @@ func TestBasic_PSAuthCamelCase(t *testing.T) {
161
154
}
162
155
163
156
script := fmt .Sprintf (cmd , clientSecret , appId )
164
- out , err := exec .Command ("powershell " , script ).Output ()
157
+ out , err := exec .Command ("pwsh" , "-Command " , script ).Output ()
165
158
if err != nil {
166
159
e := err .(* exec.ExitError )
167
160
t .Logf (string (e .Stderr ))
0 commit comments