Skip to content

Commit 1df60d2

Browse files
author
maddieclayton
committed
change exception type
1 parent fb910a9 commit 1df60d2

File tree

1 file changed

+2
-2
lines changed
  • src/ResourceManager/Profile/Commands.Profile/AzureRmAlias

1 file changed

+2
-2
lines changed

src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/AliasHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static string GetProfilePath(string Scope, SessionState sessionState)
4848
var powershellProfile = sessionState.PSVariable.GetValue("PROFILE") as PSObject;
4949
if (powershellProfile == null || !powershellProfile.Members.ToList().Any(a => a.Name.Equals("CurrentUserAllHosts")))
5050
{
51-
throw new NullReferenceException(string.Format(Properties.Resources.ProfilePathNull, "PROFILE.CurrentUserAllHosts"));
51+
throw new PSInvalidOperationException(string.Format(Properties.Resources.ProfilePathNull, "PROFILE.CurrentUserAllHosts"));
5252
}
5353
userprofile = powershellProfile.Members.ToList().Where(a => a.Name.Equals("CurrentUserAllHosts")).First().Value.ToString();
5454
}
@@ -58,7 +58,7 @@ public static string GetProfilePath(string Scope, SessionState sessionState)
5858
var powershellProfile = sessionState.PSVariable.GetValue("PROFILE") as PSObject;
5959
if (powershellProfile == null || !powershellProfile.Members.ToList().Any(a => a.Name.Equals("AllUsersAllHosts")))
6060
{
61-
throw new NullReferenceException(string.Format(Properties.Resources.ProfilePathNull, "PROFILE.AllUsersAllHosts"));
61+
throw new PSInvalidOperationException(string.Format(Properties.Resources.ProfilePathNull, "PROFILE.AllUsersAllHosts"));
6262
}
6363
userprofile = powershellProfile.Members.ToList().Where(a => a.Name.Equals("AllUsersAllHosts")).First().Value.ToString();
6464
}

0 commit comments

Comments
 (0)