Skip to content

Commit e310e6b

Browse files
authored
Merge pull request #117 from UiPath/fix/clear_current_folder
Fix clear OU/CurrentFolder between sessions
2 parents ada220f + 87ca2e5 commit e310e6b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

UiPath.PowerShell/Cmdlets/GetAuthToken.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,20 @@ protected override void ProcessRecord()
214214
}
215215
SetOrganizationUnit(authToken, OrganizationUnit);
216216
}
217-
218-
if (!string.IsNullOrWhiteSpace(FolderPath))
217+
else if (!string.IsNullOrWhiteSpace(FolderPath))
219218
{
220219
if (authToken.ApiVersion < OrchestratorProtocolVersion.V19_10)
221220
{
222221
WriteError("Use of FolderName requires Orchestrator version 19.10 or newer.");
223222
}
224223
SetCurrentFolder(authToken, FolderPath, Timeout);
225224
}
225+
else
226+
{
227+
authToken.CurrentFolder = default;
228+
authToken.OrganizationUnit = default;
229+
authToken.OrganizationUnitId = default;
230+
}
226231

227232
authToken.TenantName = authToken.TenantName ?? TenantName ?? "Default";
228233

0 commit comments

Comments
 (0)