@@ -77,34 +77,42 @@ if (process.platform === "win32") {
77
77
{
78
78
exePath : "C:\\Program Files\\PowerShell\\6\\pwsh.exe" ,
79
79
displayName : "PowerShell (x64)" ,
80
+ supportsProperArguments : true
80
81
} ,
81
82
{
82
83
exePath : "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe" ,
83
84
displayName : "PowerShell (x86)" ,
85
+ supportsProperArguments : true
84
86
} ,
85
87
{
86
88
exePath : pwshMsixPath ,
87
89
displayName : "PowerShell (Store)" ,
90
+ supportsProperArguments : true
88
91
} ,
89
92
{
90
93
exePath : "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe" ,
91
94
displayName : "PowerShell Preview (x64)" ,
95
+ supportsProperArguments : true
92
96
} ,
93
97
{
94
98
exePath : pwshPreviewMsixPath ,
95
99
displayName : "PowerShell Preview (Store)" ,
100
+ supportsProperArguments : true
96
101
} ,
97
102
{
98
103
exePath : "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe" ,
99
104
displayName : "PowerShell Preview (x86)" ,
105
+ supportsProperArguments : true
100
106
} ,
101
107
{
102
108
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
103
109
displayName : "Windows PowerShell (x64)" ,
110
+ supportsProperArguments : true
104
111
} ,
105
112
{
106
113
exePath : "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe" ,
107
114
displayName : "Windows PowerShell (x86)" ,
115
+ supportsProperArguments : true
108
116
} ,
109
117
] ,
110
118
filesystem : {
@@ -156,10 +164,12 @@ if (process.platform === "win32") {
156
164
{
157
165
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
158
166
displayName : "Windows PowerShell (x64)" ,
167
+ supportsProperArguments : true
159
168
} ,
160
169
{
161
170
exePath : "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe" ,
162
171
displayName : "Windows PowerShell (x86)" ,
172
+ supportsProperArguments : true
163
173
} ,
164
174
] ,
165
175
filesystem : {
@@ -187,34 +197,42 @@ if (process.platform === "win32") {
187
197
{
188
198
exePath : "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe" ,
189
199
displayName : "PowerShell (x86)" ,
200
+ supportsProperArguments : true
190
201
} ,
191
202
{
192
203
exePath : "C:\\Program Files\\PowerShell\\6\\pwsh.exe" ,
193
204
displayName : "PowerShell (x64)" ,
205
+ supportsProperArguments : true
194
206
} ,
195
207
{
196
208
exePath : pwshMsixPath ,
197
209
displayName : "PowerShell (Store)" ,
210
+ supportsProperArguments : true
198
211
} ,
199
212
{
200
213
exePath : "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe" ,
201
214
displayName : "PowerShell Preview (x86)" ,
215
+ supportsProperArguments : true
202
216
} ,
203
217
{
204
218
exePath : pwshPreviewMsixPath ,
205
219
displayName : "PowerShell Preview (Store)" ,
220
+ supportsProperArguments : true
206
221
} ,
207
222
{
208
223
exePath : "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe" ,
209
224
displayName : "PowerShell Preview (x64)" ,
225
+ supportsProperArguments : true
210
226
} ,
211
227
{
212
228
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
213
229
displayName : "Windows PowerShell (x86)" ,
230
+ supportsProperArguments : true
214
231
} ,
215
232
{
216
233
exePath : "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe" ,
217
234
displayName : "Windows PowerShell (x64)" ,
235
+ supportsProperArguments : true
218
236
} ,
219
237
] ,
220
238
filesystem : {
@@ -266,10 +284,12 @@ if (process.platform === "win32") {
266
284
{
267
285
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
268
286
displayName : "Windows PowerShell (x86)" ,
287
+ supportsProperArguments : true
269
288
} ,
270
289
{
271
290
exePath : "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe" ,
272
291
displayName : "Windows PowerShell (x64)" ,
292
+ supportsProperArguments : true
273
293
} ,
274
294
] ,
275
295
filesystem : {
@@ -297,22 +317,27 @@ if (process.platform === "win32") {
297
317
{
298
318
exePath : "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe" ,
299
319
displayName : "PowerShell (x86)" ,
320
+ supportsProperArguments : true
300
321
} ,
301
322
{
302
323
exePath : pwshMsixPath ,
303
324
displayName : "PowerShell (Store)" ,
325
+ supportsProperArguments : true
304
326
} ,
305
327
{
306
328
exePath : "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe" ,
307
329
displayName : "PowerShell Preview (x86)" ,
330
+ supportsProperArguments : true
308
331
} ,
309
332
{
310
333
exePath : pwshPreviewMsixPath ,
311
334
displayName : "PowerShell Preview (Store)" ,
335
+ supportsProperArguments : true
312
336
} ,
313
337
{
314
338
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
315
339
displayName : "Windows PowerShell (x86)" ,
340
+ supportsProperArguments : true
316
341
} ,
317
342
] ,
318
343
filesystem : {
@@ -353,6 +378,7 @@ if (process.platform === "win32") {
353
378
{
354
379
exePath : "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" ,
355
380
displayName : "Windows PowerShell (x86)" ,
381
+ supportsProperArguments : true
356
382
} ,
357
383
] ,
358
384
filesystem : {
@@ -361,6 +387,26 @@ if (process.platform === "win32") {
361
387
} ,
362
388
} ,
363
389
} ,
390
+ {
391
+ name : "Windows (dotnet)" ,
392
+ platformDetails : {
393
+ operatingSystem : platform . OperatingSystem . Windows ,
394
+ isOS64Bit : true ,
395
+ isProcess64Bit : true ,
396
+ } ,
397
+ environmentVars : {
398
+ "USERNAME" : "test" ,
399
+ "USERPROFILE" : "C:\\Users\\test" ,
400
+ } ,
401
+ expectedPowerShellSequence : [
402
+ { exePath : "C:\\Users\\test\\tools\\pwsh.exe" , displayName : ".NET Core PowerShell Global Tool" , supportsProperArguments : false } ,
403
+ ] ,
404
+ filesystem : {
405
+ "C:\\Users\\test\\tools" : {
406
+ "pwsh.exe" : "" ,
407
+ } ,
408
+ } ,
409
+ } ,
364
410
] ;
365
411
} else {
366
412
successTestCases = [
@@ -372,10 +418,10 @@ if (process.platform === "win32") {
372
418
isProcess64Bit : true ,
373
419
} ,
374
420
expectedPowerShellSequence : [
375
- { exePath : "/usr/bin/pwsh" , displayName : "PowerShell" } ,
376
- { exePath : "/snap/bin/pwsh" , displayName : "PowerShell Snap" } ,
377
- { exePath : "/usr/bin/pwsh-preview" , displayName : "PowerShell Preview" } ,
378
- { exePath : "/snap/bin/pwsh-preview" , displayName : "PowerShell Preview Snap" } ,
421
+ { exePath : "/usr/bin/pwsh" , displayName : "PowerShell" , supportsProperArguments : true } ,
422
+ { exePath : "/snap/bin/pwsh" , displayName : "PowerShell Snap" , supportsProperArguments : true } ,
423
+ { exePath : "/usr/bin/pwsh-preview" , displayName : "PowerShell Preview" , supportsProperArguments : true } ,
424
+ { exePath : "/snap/bin/pwsh-preview" , displayName : "PowerShell Preview Snap" , supportsProperArguments : true } ,
379
425
] ,
380
426
filesystem : {
381
427
"/usr/bin" : {
@@ -396,8 +442,8 @@ if (process.platform === "win32") {
396
442
isProcess64Bit : true ,
397
443
} ,
398
444
expectedPowerShellSequence : [
399
- { exePath : "/usr/local/bin/pwsh" , displayName : "PowerShell" } ,
400
- { exePath : "/usr/local/bin/pwsh-preview" , displayName : "PowerShell Preview" } ,
445
+ { exePath : "/usr/local/bin/pwsh" , displayName : "PowerShell" , supportsProperArguments : true } ,
446
+ { exePath : "/usr/local/bin/pwsh-preview" , displayName : "PowerShell Preview" , supportsProperArguments : true } ,
401
447
] ,
402
448
filesystem : {
403
449
"/usr/local/bin" : {
@@ -414,7 +460,7 @@ if (process.platform === "win32") {
414
460
isProcess64Bit : true ,
415
461
} ,
416
462
expectedPowerShellSequence : [
417
- { exePath : "/usr/bin/pwsh" , displayName : "PowerShell" } ,
463
+ { exePath : "/usr/bin/pwsh" , displayName : "PowerShell" , supportsProperArguments : true } ,
418
464
] ,
419
465
filesystem : {
420
466
"/usr/bin" : {
@@ -430,7 +476,7 @@ if (process.platform === "win32") {
430
476
isProcess64Bit : true ,
431
477
} ,
432
478
expectedPowerShellSequence : [
433
- { exePath : "/snap/bin/pwsh" , displayName : "PowerShell Snap" } ,
479
+ { exePath : "/snap/bin/pwsh" , displayName : "PowerShell Snap" , supportsProperArguments : true } ,
434
480
] ,
435
481
filesystem : {
436
482
"/snap/bin" : {
@@ -446,14 +492,54 @@ if (process.platform === "win32") {
446
492
isProcess64Bit : true ,
447
493
} ,
448
494
expectedPowerShellSequence : [
449
- { exePath : "/usr/local/bin/pwsh" , displayName : "PowerShell" } ,
495
+ { exePath : "/usr/local/bin/pwsh" , displayName : "PowerShell" , supportsProperArguments : true } ,
450
496
] ,
451
497
filesystem : {
452
498
"/usr/local/bin" : {
453
499
pwsh : "" ,
454
500
} ,
455
501
} ,
456
502
} ,
503
+ {
504
+ name : "MacOS (dotnet)" ,
505
+ platformDetails : {
506
+ operatingSystem : platform . OperatingSystem . MacOS ,
507
+ isOS64Bit : true ,
508
+ isProcess64Bit : true ,
509
+ } ,
510
+ environmentVars : {
511
+ "USER" : "test" ,
512
+ "HOME" : "/Users/test" ,
513
+ } ,
514
+ expectedPowerShellSequence : [
515
+ { exePath : "/Users/test/.dotnet/tools/pwsh" , displayName : ".NET Core PowerShell Global Tool" , supportsProperArguments : false } ,
516
+ ] ,
517
+ filesystem : {
518
+ "/Users/test/.dotnet/tools" : {
519
+ pwsh : "" ,
520
+ } ,
521
+ } ,
522
+ } ,
523
+ {
524
+ name : "Linux (dotnet)" ,
525
+ platformDetails : {
526
+ operatingSystem : platform . OperatingSystem . Linux ,
527
+ isOS64Bit : true ,
528
+ isProcess64Bit : true ,
529
+ } ,
530
+ environmentVars : {
531
+ "USER" : "test" ,
532
+ "HOME" : "/home/test" ,
533
+ } ,
534
+ expectedPowerShellSequence : [
535
+ { exePath : "/home/test/.dotnet/tools/pwsh" , displayName : ".NET Core PowerShell Global Tool" , supportsProperArguments : false } ,
536
+ ] ,
537
+ filesystem : {
538
+ "/home/test/.dotnet/tools" : {
539
+ pwsh : "" ,
540
+ } ,
541
+ } ,
542
+ } ,
457
543
] ;
458
544
}
459
545
@@ -559,6 +645,7 @@ describe("Platform module", function () {
559
645
560
646
assert . strictEqual ( defaultPowerShell . exePath , expectedPowerShell . exePath ) ;
561
647
assert . strictEqual ( defaultPowerShell . displayName , expectedPowerShell . displayName ) ;
648
+ assert . strictEqual ( defaultPowerShell . supportsProperArguments , expectedPowerShell . supportsProperArguments ) ;
562
649
} ) ;
563
650
}
564
651
@@ -594,6 +681,7 @@ describe("Platform module", function () {
594
681
595
682
assert . strictEqual ( foundPowerShell && foundPowerShell . exePath , expectedPowerShell . exePath ) ;
596
683
assert . strictEqual ( foundPowerShell && foundPowerShell . displayName , expectedPowerShell . displayName ) ;
684
+ assert . strictEqual ( foundPowerShell && foundPowerShell . supportsProperArguments , expectedPowerShell . supportsProperArguments ) ;
597
685
}
598
686
599
687
assert . strictEqual (
0 commit comments