Skip to content

Commit 6aea652

Browse files
authored
Hotfix for the issue on windows powershell (#15189)
* Hotfix for the issue on windows powershell * Bump version for Az.DiskPool OOB
1 parent 9d76b1e commit 6aea652

File tree

52 files changed

+1212
-422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1212
-422
lines changed

src/DiskPool/Az.DiskPool.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 5/27/2021
6+
# Generated on: 6/7/2021
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = './Az.DiskPool.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.0'
15+
ModuleVersion = '0.1.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -111,7 +111,7 @@ PrivateData = @{
111111
# IconUri = ''
112112

113113
# ReleaseNotes of this module
114-
ReleaseNotes = '* First preview release for module Az.DiskPool'
114+
ReleaseNotes = '* Hotfix for the issue on windows powershell'
115115

116116
# Prerelease string of this module
117117
# Prerelease = ''

src/DiskPool/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
-->
2020
## Upcoming Release
2121

22+
## Version 0.1.1
23+
* Hotfix for the issue on windows powershell
24+
2225
## Version 0.1.0
2326
* First preview release for module Az.DiskPool
2427

src/DiskPool/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
[assembly: ComVisible(false)]
2525
[assembly: CLSCompliant(false)]
2626
[assembly: Guid("cab30302-f17b-4dd6-8c5f-2902b85e7cec")]
27-
[assembly: AssemblyVersion("0.1.0")]
28-
[assembly: AssemblyFileVersion("0.1.0")]
27+
[assembly: AssemblyVersion("0.1.1")]
28+
[assembly: AssemblyFileVersion("0.1.1")]

src/DiskPool/build-module.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
122122

123123
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
124124
$modelCmdlets = @('Acl', 'IscsiLun')
125-
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') -Models $modelCmdlets
126-
$moduleName = 'Az.DiskPool'
125+
pwsh (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') -Models $modelCmdlets
126+
127127
if($NoDocs) {
128128
Write-Host -ForegroundColor Green 'Creating exports...'
129129
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder

src/DiskPool/custom/New-AzDiskPool.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ param(
181181
if ($PSBoundParameters.ContainsKey("DiskId")){
182182
$disk = @()
183183
for ($i = 0; $i -lt $DiskId.Count; $i++) {
184-
$diskObject= [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New()
184+
$diskObject = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk
185185
$diskObject.Id = $DiskId[$i]
186186
$disk += $diskObject
187187
}

src/DiskPool/custom/Update-AzDiskPool.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ param(
159159
if ($PSBoundParameters.ContainsKey("DiskId")){
160160
$disk = @()
161161
for ($i = 0; $i -lt $DiskId.Count; $i++) {
162-
$diskObject= [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New()
162+
$diskObject = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk
163163
$diskObject.Id = $DiskId[$i]
164164
$disk += $diskObject
165165
}

src/DiskPool/exports/ProxyCmdletDefinitions.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ param(
987987
[Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
988988
[System.String]
989989
# The name of the Disk Pool.
990-
${DiskPoolName},
990+
${Name},
991991

992992
[Parameter(ParameterSetName='Deallocate', Mandatory)]
993993
[Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
@@ -1145,7 +1145,7 @@ westeurope disk-pool-1 Microsoft.StoragePool/diskPools
11451145
.Outputs
11461146
Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
11471147
.Link
1148-
https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpool
1148+
https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpool
11491149
#>
11501150
function New-AzDiskPool {
11511151
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
@@ -1528,7 +1528,7 @@ STATICACL <IAcl[]>: Access Control List (ACL) for an iSCSI Target; defines LUN m
15281528
InitiatorIqn <String>: iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
15291529
MappedLun <String[]>: List of LUN names mapped to the ACL.
15301530
.Link
1531-
https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpooliscsitarget
1531+
https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpooliscsitarget
15321532
#>
15331533
function New-AzDiskPoolIscsiTarget {
15341534
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
@@ -1737,7 +1737,7 @@ INPUTOBJECT <IDiskPoolIdentity>: Identity Parameter
17371737
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
17381738
[SubscriptionId <String>]: The ID of the target subscription.
17391739
.Link
1740-
https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpool
1740+
https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpool
17411741
#>
17421742
function Update-AzDiskPool {
17431743
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
@@ -1944,7 +1944,7 @@ STATICACL <IAcl[]>: Access Control List (ACL) for an iSCSI Target; defines LUN m
19441944
InitiatorIqn <String>: iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
19451945
MappedLun <String[]>: List of LUN names mapped to the ACL.
19461946
.Link
1947-
https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpooliscsitarget
1947+
https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpooliscsitarget
19481948
#>
19491949
function Update-AzDiskPoolIscsiTarget {
19501950
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]

src/DiskPool/exports/Stop-AzDiskPool.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ param(
5454
[Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
5555
[System.String]
5656
# The name of the Disk Pool.
57-
${DiskPoolName},
57+
${Name},
5858

5959
[Parameter(ParameterSetName='Deallocate', Mandatory)]
6060
[Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]

src/DiskPool/generate-info.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"autorest_modelerfour": "4.15.414",
3-
"autorest_powershell": "3.0.430",
4-
"autorest_core": "3.0.6375",
52
"node": "v10.15.3",
6-
"swagger_commit": "9875f8eebd8c1392a83c052bc50a79c8251b1174",
7-
"autorest": "3.0.6187"
3+
"autorest_powershell": "3.0.431",
4+
"autorest": "3.0.6187",
5+
"autorest_core": "3.0.6375",
6+
"swagger_commit": "a252633188c5e02c4071cc1c3b5cead249db8a54",
7+
"autorest_modelerfour": "4.15.414"
88
}

src/DiskPool/generated/api/Models/Any.PowerShell.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ public partial class Any
5252

5353
partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
5454

55+
/// <summary>
56+
/// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior
57+
/// </summary>
58+
/// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param>
59+
/// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param>
60+
61+
partial void OverrideToString(ref string stringResult, ref bool returnNow);
62+
5563
/// <summary>
5664
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Any"
5765
/// />.
@@ -123,6 +131,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IAny Deserializ
123131

124132
/// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
125133
public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString();
134+
135+
public override string ToString()
136+
{
137+
var returnNow = false;
138+
var result = global::System.String.Empty;
139+
OverrideToString(ref result, ref returnNow);
140+
if (returnNow)
141+
{
142+
return result;
143+
}
144+
return ToJsonString();
145+
}
126146
}
127147
/// Any object
128148
[System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))]

src/DiskPool/generated/api/Models/Api20210401Preview/Acl.PowerShell.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ public partial class Acl
4747

4848
partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
4949

50+
/// <summary>
51+
/// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior
52+
/// </summary>
53+
/// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param>
54+
/// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param>
55+
56+
partial void OverrideToString(ref string stringResult, ref bool returnNow);
57+
5058
/// <summary>
5159
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl"
5260
/// />.
@@ -122,6 +130,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev
122130

123131
/// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
124132
public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString();
133+
134+
public override string ToString()
135+
{
136+
var returnNow = false;
137+
var result = global::System.String.Empty;
138+
OverrideToString(ref result, ref returnNow);
139+
if (returnNow)
140+
{
141+
return result;
142+
}
143+
return ToJsonString();
144+
}
125145
}
126146
/// Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
127147
[System.ComponentModel.TypeConverter(typeof(AclTypeConverter))]

src/DiskPool/generated/api/Models/Api20210401Preview/Disk.PowerShell.cs

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ public partial class Disk
4747

4848
partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
4949

50+
/// <summary>
51+
/// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior
52+
/// </summary>
53+
/// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param>
54+
/// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param>
55+
56+
partial void OverrideToString(ref string stringResult, ref bool returnNow);
57+
5058
/// <summary>
5159
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk"
5260
/// />.
@@ -74,39 +82,39 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev
7482
}
7583

7684
/// <summary>
77-
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk"
85+
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk"
7886
/// />.
7987
/// </summary>
80-
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
81-
internal Disk(global::System.Collections.IDictionary content)
88+
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
89+
internal Disk(global::System.Management.Automation.PSObject content)
8290
{
8391
bool returnNow = false;
84-
BeforeDeserializeDictionary(content, ref returnNow);
92+
BeforeDeserializePSObject(content, ref returnNow);
8593
if (returnNow)
8694
{
8795
return;
8896
}
8997
// actually deserialize
9098
((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id, global::System.Convert.ToString);
91-
AfterDeserializeDictionary(content);
99+
AfterDeserializePSObject(content);
92100
}
93101

94102
/// <summary>
95-
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk"
103+
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk"
96104
/// />.
97105
/// </summary>
98-
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
99-
internal Disk(global::System.Management.Automation.PSObject content)
106+
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
107+
internal Disk(global::System.Collections.IDictionary content)
100108
{
101109
bool returnNow = false;
102-
BeforeDeserializePSObject(content, ref returnNow);
110+
BeforeDeserializeDictionary(content, ref returnNow);
103111
if (returnNow)
104112
{
105113
return;
106114
}
107115
// actually deserialize
108116
((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id, global::System.Convert.ToString);
109-
AfterDeserializePSObject(content);
117+
AfterDeserializeDictionary(content);
110118
}
111119

112120
/// <summary>
@@ -120,6 +128,18 @@ internal Disk(global::System.Management.Automation.PSObject content)
120128

121129
/// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
122130
public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString();
131+
132+
public override string ToString()
133+
{
134+
var returnNow = false;
135+
var result = global::System.String.Empty;
136+
OverrideToString(ref result, ref returnNow);
137+
if (returnNow)
138+
{
139+
return result;
140+
}
141+
return ToJsonString();
142+
}
123143
}
124144
/// Azure Managed Disk to attach to the Disk Pool.
125145
[System.ComponentModel.TypeConverter(typeof(DiskTypeConverter))]

0 commit comments

Comments
 (0)