Skip to content

Commit 83e9d15

Browse files
author
Maddie Clayton
authored
Merge pull request Azure#6780 from Azure/task-adls-fixenabledebugging
Fix debugging when DebugPreference is set from powershell command line
2 parents db5f1f5 + 5540a2d commit 83e9d15

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Current Release
2121
* Updated all help files to include full parameter types and correct input/output types.
2222
* Updated the DataPlane SDK (Microsoft.Azure.DataLake.Store) version to 1.1.9
23+
* Fix debugging when DebugPreference is set from powershell command line
2324

2425
## Version 6.1.0
2526
* Add cancellation support and progress tracking for Set-AzureRmDataLakeStoreItemAclEntry, Remove-AzureRmDataLakeStoreItemAclEntry, Set-AzureRmDataLakeStoreItemAcl

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneModels/DataLakeStoreFileSystemClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public DataLakeStoreFileSystemClient(IAzureContext context, DataLakeStoreFileSys
8989
}
9090
else
9191
{
92-
var debugPreference = cmdlet.GetVariableValue("DebugPreference") as string;
92+
// The return type of cmdlet.GetVariableValue("DebugPreference") is string when run from a script
93+
// return type is System.Management.Automation.ActionPreference when run from commandline
94+
var debugPreference = cmdlet.GetVariableValue("DebugPreference").ToString();
9395
if (debugPreference != null)
9496
{
9597
_isDebugEnabled = !debugPreference.Equals("SilentlyContinue");

0 commit comments

Comments
 (0)