Skip to content

Commit eebc5a0

Browse files
author
Vini Soto
committed
Addressing static analysis failures
1 parent df7834c commit eebc5a0

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/EnterAzureRmWebAppContainerPSSession.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
1818
/// <summary>
1919
/// this commandlet will create remote ps session with site
2020
/// </summary>
21-
[Cmdlet("Enter", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerPSSession")]
21+
[Cmdlet("Enter", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerPSSession", DefaultParameterSetName = ParameterSet1Name, SupportsShouldProcess = true)]
22+
[OutputType(typeof(void))]
2223
public class EnterAzureRmWebAppContainerPSSession : WebAppBaseCmdlet
2324
{
25+
[Parameter(Mandatory = false, HelpMessage = "Return a value indicating success or failure")]
26+
public SwitchParameter PassThru { get; set; }
27+
2428
[Parameter(ParameterSetName = ParameterSet1Name, Position = 1, Mandatory = false, HelpMessage = "The name of the web app slot.", ValueFromPipelineByPropertyName = true)]
2529
[ValidateNotNullOrEmpty]
2630
public string SlotName { get; set; }
@@ -34,7 +38,10 @@ public override void ExecuteCmdlet()
3438
Name = name;
3539
SlotName = slot;
3640
}
37-
WebsitesClient.RunWebAppContainerPSSessionScript(this, ResourceGroupName, Name, SlotName);
41+
if (ShouldProcess(Properties.Resources.EnterPSSessionWarning))
42+
{
43+
WebsitesClient.RunWebAppContainerPSSessionScript(this, ResourceGroupName, Name, SlotName);
44+
}
3845
}
3946
}
4047
}

src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/GetAzureRMWebAppContainerContinuousDeploymentUrl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
1717
/// <summary>
1818
/// this commandlet will return ContainerContinuousDeploymentUrl
1919
/// </summary>
20-
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerContinuousDeploymentUrl")]
20+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerContinuousDeploymentUrl", DefaultParameterSetName = ParameterSet1Name)]
2121
[OutputType(typeof(string))]
2222
public class GetAzureRMWebAppContainerContinuousDeploymentUrl : WebAppBaseCmdlet
2323
{

src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureRmWebAppContainerPSSession.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
1818
/// <summary>
1919
/// this commandlet will create remote ps session with site
2020
/// </summary>
21-
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerPSSession")]
21+
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerPSSession", DefaultParameterSetName = ParameterSet1Name, SupportsShouldProcess = true)]
2222
[OutputType(typeof(System.Management.Automation.Runspaces.PSSession))]
2323
public class NewAzureRmWebAppContainerPSSession : WebAppBaseCmdlet
2424
{
@@ -35,7 +35,10 @@ public override void ExecuteCmdlet()
3535
Name = name;
3636
SlotName = slot;
3737
}
38-
WebsitesClient.RunWebAppContainerPSSessionScript(this, ResourceGroupName, Name, SlotName, true);
38+
if (ShouldProcess(Properties.Resources.EnterPSSessionWarning))
39+
{
40+
WebsitesClient.RunWebAppContainerPSSessionScript(this, ResourceGroupName, Name, SlotName, true);
41+
}
3942
}
4043
}
4144
}

src/ResourceManager/Websites/Commands.Websites/Properties/Resources.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Websites/Commands.Websites/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,7 @@
162162
<value>Failed to add git remote to directory '{0}' with error '{1}'</value>
163163
<comment>{0} = directory, {1} = error message</comment>
164164
</data>
165+
<data name="EnterPSSessionWarning" xml:space="preserve">
166+
<value>This will modify LocalHost\Client\TrustedHosts and LocalHost\Client\Auth policy. Continue?</value>
167+
</data>
165168
</root>

0 commit comments

Comments
 (0)