Skip to content

Commit 41c1e7b

Browse files
authored
update context missing error message (#23457)
1 parent 501a64a commit 41c1e7b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Updated error message when storage context is missing in a cmdlet input
2122

2223
## Version 6.0.0
2324
* Supported customer initiated migration

src/Storage/Storage/Common/StorageCloudCmdletBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ internal AzureStorageContext GetCmdletStorageContext(IStorageContext inContext,
303303
}
304304
else
305305
{
306-
throw new InvalidOperationException("Could not get the storage context. Please pass in a storage context or set the current storage context.");
306+
throw new InvalidOperationException("Could not get the storage context. Please pass in a storage context with \"-Context\" parameter (can be created with New-AzStorageContext cmdlet), " +
307+
"or set the current storage context with Set-AzCurrentStorageAccount cmdlet.");
307308
}
308309
}
309310
catch (Exception e)

0 commit comments

Comments
 (0)