Skip to content

Commit 487a2bd

Browse files
author
Hovsep Mkrtchyan
committed
Fixed "Select-AzureRmProfile should throw if profile file is missing" Azure#2246
1 parent 0fddf41 commit 487a2bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public override void ExecuteCmdlet()
4646
{
4747
if (!string.IsNullOrEmpty(Path))
4848
{
49+
if(!Common.Authentication.AzureSession.DataStore.FileExists(Path))
50+
{
51+
throw new PSArgumentException(string.Format("Cannot find file '{0}'", Path));
52+
}
53+
4954
AzureRmProfileProvider.Instance.Profile = new AzureRMProfile(Path);
5055
}
5156
else

0 commit comments

Comments
 (0)