@@ -23,7 +23,6 @@ $script:CompatibilityTestCases = @(
23
23
@ { Target = $script :Srv2012_3_profile ; Script = ' "Hello World" | ConvertFrom-String | Get-Member' ; Commands = @ (" ConvertFrom-String" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
24
24
@ { Target = $script :Srv2012_3_profile ; Script = ' Compress-Archive -LiteralPath C:\Reference\Draftdoc.docx, C:\Reference\Images\diagram2.vsd -CompressionLevel Optimal -DestinationPath C:\Archives\Draft.Zip' ; Commands = @ (" Compress-Archive" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
25
25
@ { Target = $script :Srv2012_3_profile ; Script = ' Get-Runspace -Id 2' ; Commands = @ (" Get-Runspace" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
26
- @ { Target = $script :Srv2012_3_profile ; Script = ' $Protected = "Hello World" | Protect-CmsMessage -To "*youralias@emailaddress.com*"' ; Commands = @ (" Protect-CmsMessage" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
27
26
@ { Target = $script :Srv2012_3_profile ; Script = ' Format-Hex -Path "C:\temp\temp.t7f"' ; Commands = @ (" Format-Hex" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
28
27
@ { Target = $script :Srv2012_3_profile ; Script = ' Set-Clipboard -Value "This is a test string"' ; Commands = @ (" Set-Clipboard" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
29
28
@ { Target = $script :Srv2012_3_profile ; Script = ' Clear-RecycleBin -Force' ; Commands = @ (" Clear-RecycleBin" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
@@ -120,10 +119,7 @@ $script:ParameterCompatibilityTestCases = @(
120
119
@ { Target = $script :Srv2012_3_profile ; Script = ' Save-Help -FullyQualifiedModule @{ ModuleName = "MyModule"; MaximumVersion = "2.7" }' ; Commands = @ (' Save-Help' ); Parameters = @ (' FullyQualifiedModule' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
121
120
@ { Target = $script :Srv2012_3_profile ; Script = ' Export-PSSession -FullyQualifiedModule @{ ModuleName = "MyModule"; RequiredVersion = $reqVer }' ; Commands = @ (' Export-PSSession' ); Parameters = @ (' FullyQualifiedModule' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
122
121
@ { Target = $script :Srv2012_3_profile ; Script = ' Get-Command -FullyQualifiedModule @{ ModuleName = $m; MaximumVersion = $maxVer }' ; Commands = @ (' Get-Command' ); Parameters = @ (' FullyQualifiedModule' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
123
- @ { Target = $script :Srv2012_3_profile ; Script = ' Register-ScheduledJob -RunNow -Trigger $t' ; Commands = @ (' Register-ScheduledJob' ); Parameters = @ (' RunNow' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
124
122
@ { Target = $script :Srv2012_3_profile ; Script = ' Get-Module -FullyQualifiedName @{ ModuleName = $m; ModuleVersion = $v }' ; Commands = @ (' Get-Module' ); Parameters = @ (' FullyQualifiedName' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
125
- @ { Target = $script :Srv2012_3_profile ; Script = ' New-JobTrigger -At "1/20/2012 3:00 AM" -RepeatIndefinitely' ; Commands = @ (' New-JobTrigger' ); Parameters = @ (' RepeatIndefinitely' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
126
- @ { Target = $script :Srv2012_3_profile ; Script = ' $t = Get-ScheduledJob | Get-JobTrigger | Enable-JobTrigger -PassThru' ; Commands = @ (' Enable-JobTrigger' ); Parameters = @ (' PassThru' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
127
123
@ { Target = $script :Srv2012_3_profile ; Script = ' Get-Process -PipelineVariable proc | ForEach-Object { Format-Table $Proc }' ; Commands = @ (' Get-Process' ); Parameters = @ (' PipelineVariable' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
128
124
@ { Target = $script :Srv2012_3_profile ; Script = ' Get-Process -IncludeUserName' ; Commands = @ (' Get-Process' ); Parameters = @ (' IncludeUserName' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
129
125
@@ -155,6 +151,20 @@ $script:ParameterCompatibilityTestCases = @(
155
151
@ { Target = $script :Srv2019_6_1_profile ; Script = ' Start-Service "eventlog" -ComputerName "MyComputer"' ; Commands = @ (' Start-Service' ); Parameters = @ (' ComputerName' ); Version = ' 6.1' ; OS = ' Windows' ; ProblemCount = 1 }
156
152
)
157
153
154
+ # Disabled on AppVeyor's Ubuntu image until fixed
155
+ if (-not $IsLinux -and $env: APPVEYOR ) {
156
+ $script :CompatibilityTestCases += @ (
157
+ @ { Target = $script :Srv2012_3_profile ; Script = ' $Protected = "Hello World" | Protect-CmsMessage -To "*youralias@emailaddress.com*"' ; Commands = @ (" Protect-CmsMessage" ); Version = " 3.0" ; OS = " Windows" ; ProblemCount = 1 }
158
+ )
159
+
160
+ $script :ParameterCompatibilityTestCases += @ (
161
+ @ { Target = $script :Srv2012_3_profile ; Script = ' Register-ScheduledJob -RunNow -Trigger $t' ; Commands = @ (' Register-ScheduledJob' ); Parameters = @ (' RunNow' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
162
+ @ { Target = $script :Srv2012_3_profile ; Script = ' New-JobTrigger -At "1/20/2012 3:00 AM" -RepeatIndefinitely' ; Commands = @ (' New-JobTrigger' ); Parameters = @ (' RepeatIndefinitely' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
163
+ @ { Target = $script :Srv2012_3_profile ; Script = ' $t = Get-ScheduledJob | Get-JobTrigger | Enable-JobTrigger -PassThru' ; Commands = @ (' Enable-JobTrigger' ); Parameters = @ (' PassThru' ); Version = ' 3.0' ; OS = ' Windows' ; ProblemCount = 1 }
164
+ )
165
+ }
166
+
167
+
158
168
Describe ' UseCompatibleCommands' {
159
169
Context ' Targeting a single profile' {
160
170
It " Reports <ProblemCount> command incompatibilties with '<Script>' on <OS> with PowerShell <Version>" - TestCases $script :CompatibilityTestCases {
@@ -360,4 +370,4 @@ Describe 'UseCompatibleCommands' {
360
370
}
361
371
}
362
372
}
363
- }
373
+ }
0 commit comments