Skip to content

Commit d9b6c1c

Browse files
committed
Bug fixes: 1908985, 1907418, 1898689,1901426
2 parents be48699 + 7f45762 commit d9b6c1c

11 files changed

+92
-26
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/GetAzureRemoteAppCollectionUsageSummary.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.RemoteApp;
16+
using Microsoft.Azure.Commands.RemoteApp;
1617
using Microsoft.Azure.Management.RemoteApp.Models;
1718
using System;
1819
using System.Collections.Generic;
@@ -29,6 +30,7 @@ public class GetAzureRemoteAppCollectionUsageSummary : RdsCmdlet
2930
Position = 0,
3031
ValueFromPipelineByPropertyName = true,
3132
HelpMessage = "RemoteApp collection name")]
33+
[ValidatePattern(NameValidatorString)]
3234
public string CollectionName { get; set; }
3335

3436
[Parameter(Mandatory = false,
@@ -67,7 +69,7 @@ public override void ExecuteCmdlet()
6769
}
6870
else
6971
{
70-
WriteVerboseWithTimestamp("No usage found for the requested period.");
72+
WriteVerboseWithTimestamp(Commands_RemoteApp.UseageNotFound);
7173
}
7274
}
7375
}

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/UpdateAzureRemoteAppCollection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.RemoteApp;
16+
using Microsoft.Azure.Commands.RemoteApp;
1617
using Microsoft.Azure.Management.RemoteApp.Models;
1718
using System.Management.Automation;
1819

@@ -34,6 +35,7 @@ public class UpdateAzureRemoteAppCollection : RdsCmdlet
3435
ValueFromPipelineByPropertyName = true,
3536
HelpMessage = "The name of the RemoteApp template image."
3637
)]
38+
[ValidatePattern(TemplateNameValidatorString)]
3739
public string ImageName { get; set; }
3840

3941
public override void ExecuteCmdlet()
@@ -53,7 +55,7 @@ public override void ExecuteCmdlet()
5355
PlanName = collection.PlanName
5456
};
5557

56-
if (ShouldProcess(CollectionName, "Update collection"))
58+
if (ShouldProcess(CollectionName, Commands_RemoteApp.UpdateCollection))
5759
{
5860
response = CallClient(() => Client.Collections.Set(CollectionName, false, false, details), Client.Collections);
5961
}

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.Designer.cs

Lines changed: 49 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.resx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,28 @@
216216
<data name="VnetSharedKeyResetCaptionMessage" xml:space="preserve">
217217
<value>This operation will reset the shared key for the VNet's VPN device. This will interrupt connectivity to the on-premises network until you configure the VPN device to use the new shared key.</value>
218218
</data>
219-
<data name="VnetSharedKeyResetConfirmationDescription" xml:space="preserve">
220-
<value>Resetting the VPN shared key</value>
219+
<data name="VnetSharedKeyResetConfirmationDescriptionFormat" xml:space="preserve">
220+
<value>Resetting the VPN shared key on {0}</value>
221221
</data>
222222
<data name="WaitingForStorageVerificationToCompleteMessage" xml:space="preserve">
223223
<value>Waiting for Storage verification to complete</value>
224224
</data>
225225
<data name="TemplateImageUploadPendingMessage" xml:space="preserve">
226226
<value>Pending upload template image</value>
227227
</data>
228+
<data name="JobComplete" xml:space="preserve">
229+
<value>ProcessJob completed</value>
230+
</data>
231+
<data name="Publish" xml:space="preserve">
232+
<value>Publish RemoteApp</value>
233+
</data>
234+
<data name="Publishing" xml:space="preserve">
235+
<value>Publishing Application use Get-Job to view status</value>
236+
</data>
237+
<data name="UpdateCollection" xml:space="preserve">
238+
<value>Update collection</value>
239+
</data>
240+
<data name="UseageNotFound" xml:space="preserve">
241+
<value>No usage found for the requested period.</value>
242+
</data>
228243
</root>

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Common/RemoteAppRegEx.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public abstract partial class RdsCmdlet
3030

3131
protected const string UserPrincipalValdatorString = UserNameValidatorString + "@" + DomainNameValidatorString;
3232

33+
protected const string TemplateNameValidatorString = @"^[A-Za-z][._\-A-Za-z0-9]{1,61}[A-Z-a-z0-9]$";
34+
3335
protected const string IPv4ValidatorString = @"^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$";
3436

3537
protected const string IPv6ValidatorString = @"(?<![:.\w])(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}(?![:.\w])";

src/ServiceManagement/RemoteApp/Commands.RemoteApp/RemoteProgram/PublishAzureRemoteAppProgram.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Management.RemoteApp;
15+
using Microsoft.Azure.Commands.RemoteApp;
1616
using Microsoft.Azure.Management.RemoteApp.Models;
1717
using System;
1818
using System.IO;
1919
using System.Management.Automation;
2020

2121
namespace Microsoft.Azure.Management.RemoteApp.Cmdlets
2222
{
23-
[Cmdlet(VerbsData.Publish, "AzureRemoteAppProgram", DefaultParameterSetName = AppId), OutputType(typeof(PublishingOperationResult))]
23+
[Cmdlet(VerbsData.Publish, "AzureRemoteAppProgram", DefaultParameterSetName = AppId), OutputType(typeof(PublishingOperationResult), typeof(Job))]
2424
public class PublishAzureRemoteAppProgram : RdsCmdlet
2525
{
2626
private const string AppPath = "App Path";
@@ -125,13 +125,16 @@ public override void ExecuteCmdlet()
125125
{
126126
if (AsJob.IsPresent)
127127
{
128-
task = new LongRunningTask<PublishAzureRemoteAppProgram>(this, "RemoteAppBackgroundTask", "Publish RemoteApp");
128+
task = new LongRunningTask<PublishAzureRemoteAppProgram>(this, "RemoteAppBackgroundTask", Commands_RemoteApp.Publish);
129129

130130
task.ProcessJob(() =>
131131
{
132+
task.SetStatus(Commands_RemoteApp.Publishing);
132133
PublishAction();
133-
task.SetStatus("ProcessJob completed");
134+
task.SetStatus(Commands_RemoteApp.JobComplete);
134135
});
136+
137+
WriteObject(task);
135138
}
136139
else
137140
{

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Vnet/GetAzureRemoteAppVnet.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class GetAzureRemoteAppVNet : RdsCmdlet
2626
Position = 0,
2727
ValueFromPipeline = true,
2828
HelpMessage = "RemoteApp virtual network name. Wildcards are permitted.")]
29+
[ValidatePattern(VNetNameValidatorStringWithWildCards)]
2930
public string VNetName { get; set; }
3031

3132
[Parameter(Mandatory = false,

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Vnet/GetAzureRemoteAppVpnDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class GetAzureRemoteAppVpnDevice : RdsCmdlet
2525
Position = 0,
2626
ValueFromPipeline = true,
2727
HelpMessage = "RemoteApp virtual network name.")]
28-
[ValidatePattern(VNetNameValidatorStringWithWildCards)]
28+
[ValidatePattern(VNetNameValidatorString)]
2929
public string VNetName { get; set; }
3030

3131
public override void ExecuteCmdlet()

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Vnet/GetAzureRemoteAppVpnDeviceConfigScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class GetAzureRemoteAppVpnDeviceConfigScript : RdsCmdlet
2626
Position = 0,
2727
ValueFromPipeline = true,
2828
HelpMessage = "RemoteApp virtual network name.")]
29-
[ValidatePattern(VNetNameValidatorStringWithWildCards)]
29+
[ValidatePattern(VNetNameValidatorString)]
3030
public string VNetName { get; set; }
3131

3232
[Parameter(Mandatory = true,

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Vnet/ResetAzureRemoteAppVpnSharedKey.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.Azure.Commands.RemoteApp;
1616
using Microsoft.Azure.Management.RemoteApp;
1717
using Microsoft.Azure.Management.RemoteApp.Models;
18+
using System;
1819
using System.Management.Automation;
1920

2021
namespace Microsoft.Azure.Management.RemoteApp.Cmdlets
@@ -23,17 +24,17 @@ namespace Microsoft.Azure.Management.RemoteApp.Cmdlets
2324
[Cmdlet(VerbsCommon.Reset, "AzureRemoteAppVpnSharedKey", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High), OutputType(typeof(VNet))]
2425
public class ResetAzureRemoteAppVpnSharedKey : RdsCmdlet
2526
{
26-
[Parameter(Mandatory = false,
27+
[Parameter(Mandatory = true,
2728
Position = 0,
2829
ValueFromPipeline = true,
2930
HelpMessage = "RemoteApp virtual network name.")]
30-
[ValidatePattern(VNetNameValidatorStringWithWildCards)]
31+
[ValidatePattern(VNetNameValidatorString)]
3132
public string VNetName { get; set; }
3233

3334
public override void ExecuteCmdlet()
3435
{
3536
OperationResultWithTrackingId response = null;
36-
string description = Commands_RemoteApp.VnetSharedKeyResetConfirmationDescription;
37+
string description = String.Format(Commands_RemoteApp.VnetSharedKeyResetConfirmationDescriptionFormat, VNetName);
3738
string warning = Commands_RemoteApp.GenericAreYouSureQuestion;
3839
string caption = Commands_RemoteApp.VnetSharedKeyResetCaptionMessage;
3940

@@ -62,7 +63,8 @@ public override void ExecuteCmdlet()
6263
VNetResult vnet = CallClient(() => Client.VNet.Get(VNetName, true), Client.VNet);
6364
WriteObject(vnet.VNet);
6465

65-
WriteVerboseWithTimestamp("The request completed successfully.");
66+
WriteVerboseWithTimestamp("The request completed successfully." +
67+
" Call Get-AzureRemoteAppVpnDeviceConfigScript to download the script and pass in the SharedKey returned by this cmdlet");
6668
}
6769
else
6870
{

src/ServiceManagement/RemoteApp/Commands.RemoteApp/WorkSpace/SetAzureRemoteAppWorkspace.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace Microsoft.Azure.Management.RemoteApp.Cmdlets
2020
{
21-
[Cmdlet(VerbsCommon.Set, "AzureRemoteAppWorkspace"), OutputType(typeof(TrackingResult))]
21+
[Cmdlet(VerbsCommon.Set, "AzureRemoteAppWorkspace")]
2222
public class SetAzureRemoteAppWorkspace : RdsCmdlet
2323
{
2424
[Parameter(Mandatory = true,
@@ -29,7 +29,6 @@ public class SetAzureRemoteAppWorkspace : RdsCmdlet
2929

3030
public override void ExecuteCmdlet()
3131
{
32-
OperationResultWithTrackingId response = null;
3332
AccountDetailsParameter details = new AccountDetailsParameter()
3433
{
3534
AccountInfo = new AccountDetails()
@@ -38,12 +37,7 @@ public override void ExecuteCmdlet()
3837
}
3938
};
4039

41-
response = CallClient(() => Client.Account.Set(details), Client.Account);
42-
43-
if (response != null)
44-
{
45-
WriteTrackingId(response);
46-
}
40+
CallClient(() => Client.Account.Set(details), Client.Account);
4741
}
4842

4943
}

0 commit comments

Comments
 (0)