@autorest/powershell 4.0.664 → 4.0.666

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  {
2
- "nonCachedDurationMs": 11334.689707000041
2
+ "nonCachedDurationMs": 9969.545497999992
3
3
  }
@@ -75,7 +75,7 @@
75
75
  "powershell/models/model-extensions.ts": "f0c617b9bfb04b4424a853e1b1eecba9059ba788",
76
76
  "powershell/module/module-class.ts": "327af665b5d81e4cc1b8fa9da7382e9c73300de5",
77
77
  "powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
78
- "powershell/package.json": "57199af362e5101fe20837c1be163988dfa73df1",
78
+ "powershell/package.json": "33f0aa6a5cce43602d087e48f9bc998cfc9dde44",
79
79
  "powershell/plugins/add-azure-completers-v2.ts": "3b1ddf7a067dbac2f07561fb3f6cbf1b66e555aa",
80
80
  "powershell/plugins/create-commands-v2.ts": "915b737aad5f455a9cd0aa4e08034349a2de8ea0",
81
81
  "powershell/plugins/cs-namer-v2.ts": "1b64031416f18b604950012b5683758adefce535",
@@ -103,7 +103,7 @@
103
103
  "powershell/resources/assets/export-surface.ps1": "836175c819a8e55a8318c9b12f7c976fdaec8ea7",
104
104
  "powershell/resources/assets/exports/README.md": "c8a90f9d2e9134c3366ae18eb6f2d5f169a8ee4b",
105
105
  "powershell/resources/assets/generate-help.ps1": "1cec43282a5211ed030759f35515b562421f014f",
106
- "powershell/resources/assets/generate-portal-ux.ps1": "f2b83288ff9aca145987707200e4ae71a4565d74",
106
+ "powershell/resources/assets/generate-portal-ux.ps1": "ddab98434f7681f3ee6b5a5d1cf7f6838e8defc8",
107
107
  "powershell/resources/assets/how-to.md": "a2fc9c53d35275e0e4cd8423e4e194744d359afd",
108
108
  "powershell/resources/assets/internal/README.md": "ec115a67f403df03f07892213b3b9e83867cdd41",
109
109
  "powershell/resources/assets/license.txt": "b9f3180fb9aff09aa7665db6b3226e492f670be6",
@@ -217,7 +217,7 @@
217
217
  "powershell/resources/psruntime/BuildTime/Cmdlets/ExportModelSurface.cs": "e4af60bd7ad7b57a036474c5aed7c4cab4b1997d",
218
218
  "powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs": "0a6ff3d27cf9a5fd967a34e2f4add88a62b5783a",
219
219
  "powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs": "b3833ffb92514646dc99611eaf5aab4e4a232664",
220
- "powershell/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs": "de542c01e02246f2886d4736b028190b351ac988",
220
+ "powershell/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs": "7402e85a799d19cba3eb2ad563ca792647ef9578",
221
221
  "powershell/resources/psruntime/BuildTime/Cmdlets/GetCommonParameter.cs": "bf5c757829449599eee8ff1786b3198d703ed7a6",
222
222
  "powershell/resources/psruntime/BuildTime/Cmdlets/GetModuleGuid.cs": "e8d5baed5d143fc557c4a3b0aefd14308f32fac2",
223
223
  "powershell/resources/psruntime/BuildTime/Cmdlets/GetScriptCmdlet.cs": "1b136635ba83a4df5990669d0094092692b49b12",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/powershell",
3
- "version": "4.0.664",
3
+ "version": "4.0.666",
4
4
  "description": "AutoRest PowerShell Cmdlet Generator",
5
5
  "main": "dist/exports.js",
6
6
  "typings": "dist/exports.d.ts",
@@ -31,8 +31,6 @@ $instance = [${$project.serviceNamespace.moduleClass.declaration}]::Instance
31
31
  $moduleInfo = Get-Module -Name $moduleName
32
32
  $parameterSetsInfo = Get-Module -Name "$moduleName.private"
33
33
 
34
- $buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
35
-
36
34
  function Test-FunctionSupported()
37
35
  {
38
36
  [CmdletBinding()]
@@ -42,7 +40,7 @@ function Test-FunctionSupported()
42
40
  $FunctionName
43
41
  )
44
42
 
45
- If ($buildinfunctions.Contains($FunctionName)) {
43
+ If (-not $FunctionName.Contains("_")) {
46
44
  return $false
47
45
  }
48
46
 
@@ -300,7 +298,7 @@ function New-MetadataForCmdlet()
300
298
  return $result
301
299
  }
302
300
 
303
- $parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) }
301
+ $parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) }
304
302
  $resourceTypes = @{}
305
303
  foreach ($parameterSetName in $parameterSets)
306
304
  {
@@ -56,6 +56,31 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
56
56
  return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_})
57
57
  }
58
58
  }
59
+ function Start-TestSleep {
60
+ [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')]
61
+ param(
62
+ [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')]
63
+ [ValidateRange(0.0, 2147483.0)]
64
+ [double] $Seconds,
65
+
66
+ [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')]
67
+ [ValidateRange('NonNegative')]
68
+ [Alias('ms')]
69
+ [int] $Milliseconds
70
+ )
71
+
72
+ if ($TestMode -ne 'playback') {
73
+ switch ($PSCmdlet.ParameterSetName) {
74
+ 'SleepBySeconds' {
75
+ Start-Sleep -Seconds $Seconds
76
+ }
77
+ 'SleepByMilliseconds' {
78
+ Start-Sleep -Milliseconds $Milliseconds
79
+ }
80
+ }
81
+ }
82
+ }
83
+
59
84
  $env = @{}
60
85
  if ($UsePreviousConfigForRecord) {
61
86
  $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json