Skip to content

Commit c87f56c

Browse files
authored
Stop loading $PROFILE and checking for updates (#22854)
Fixes #22853
1 parent a691c14 commit c87f56c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

sdk/identity/Azure.Identity/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs Fixed
1010

11+
- Stopped loading `$PROFILE` and checking for updates when using `AzurePowerShellCredential`.
12+
1113
### Other Changes
1214

1315
## 1.5.0-beta.2 (2021-07-12)

sdk/identity/Azure.Identity/src/AzurePowerShellCredential.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,20 @@ private static ProcessStartInfo GetAzurePowerShellProcessStartInfo(string fileNa
188188
UseShellExecute = false,
189189
ErrorDialog = false,
190190
CreateNoWindow = true,
191-
WorkingDirectory = DefaultWorkingDir
191+
WorkingDirectory = DefaultWorkingDir,
192+
Environment =
193+
{
194+
["POWERSHELL_UPDATECHECK"] = "Off",
195+
},
192196
};
193197

194198
private void GetFileNameAndArguments(string resource, string tenantId, out string fileName, out string argument)
195199
{
196-
string powershellExe = "pwsh -NonInteractive -EncodedCommand";
200+
string powershellExe = "pwsh -NoProfile -NonInteractive -EncodedCommand";
197201

198202
if (UseLegacyPowerShell)
199203
{
200-
powershellExe = "powershell -NonInteractive -EncodedCommand";
204+
powershellExe = "powershell -NoProfile -NonInteractive -EncodedCommand";
201205
}
202206

203207
var tenantIdArg = tenantId == null ? string.Empty : $" -TenantId {tenantId}";

0 commit comments

Comments
 (0)