Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Common/AzureLongRunningJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ internal string GetShouldMethodFailureReaon(T cmdlet, ShouldMethodStreamItem met
switch (methodType)
{
case ShouldMethodType.ShouldProcess:
if (boundParameters != null && boundParameters.ContainsKey("Confirm") && (bool)boundParameters["Confirm"])
if (boundParameters != null && boundParameters.ContainsKey("Confirm") && Convert.ToBoolean(boundParameters["Confirm"].ToString()))
{
result += Resources.ShouldProcessFailConfirm;
}
else if (boundParameters != null && boundParameters.ContainsKey("WhatIf") && (bool)boundParameters["WhatIf"])
else if (boundParameters != null && boundParameters.ContainsKey("WhatIf") && Convert.ToBoolean(boundParameters["WhatIf"].ToString()))
{
result += Resources.ShouldProcessFailWhatIf;
}
Expand Down Expand Up @@ -539,8 +539,8 @@ static string SafeGetVariableValue(PSCmdlet cmdlet, string name, string defaultV
/// <returns>True if ShouldProcess does not need to be executed, false otherwise</returns>
bool CanHandleShouldProcessLocally()
{
return !(_cmdlet.MyInvocation.BoundParameters.ContainsKey("Confirm") && (bool)_cmdlet.MyInvocation.BoundParameters["Confirm"]) &&
!(_cmdlet.MyInvocation.BoundParameters.ContainsKey("WhatIf") && (bool)_cmdlet.MyInvocation.BoundParameters["WhatIf"]) &&
return !(_cmdlet.MyInvocation.BoundParameters.ContainsKey("Confirm") && Convert.ToBoolean(_cmdlet.MyInvocation.BoundParameters["Confirm"].ToString())) &&
!(_cmdlet.MyInvocation.BoundParameters.ContainsKey("WhatIf") && Convert.ToBoolean(_cmdlet.MyInvocation.BoundParameters["WhatIf"].ToString())) &&
!_shouldConfirm;
}

Expand All @@ -554,7 +554,7 @@ protected void ThrowIfJobFailedOrCancelled()
{
if (IsFailedOrCancelled(JobStateInfo.State))
{
throw new LongRunningJobCancelledException("Azure Long running job is stopping, cnanot perform any action");
throw new LongRunningJobCancelledException("Azure Long running job is stopping, cannot perform any action");
}
}
}
Expand Down