# \#invoke-powershell

**URL:** https://forum.uipath.com/tag/invoke-powershell/1568.md

[Récents](https://forum.uipath.com/latest.md) · [Catégories](https://forum.uipath.com/categories.md) · [Étiquettes](https://forum.uipath.com/tags.md)

---

## [Invoke Power Shell - Une erreur s'est produite avec PowerShell. Une session à distance pourrait être terminée.](https://forum.uipath.com/t/invoke-power-shell-an-error-occured-with-powershell-cannot-handle-a-remote-session-might-have-ended/5764707)

<div class="topic-metadata">

**Author:** [@maziz17j](https://forum.uipath.com/u/maziz17j)\
**Réponses:** 1\
**Dernière mise à jour :** [Juillet 28, 2026, 6:19 UTC](https://forum.uipath.com/t/invoke-power-shell-an-error-occured-with-powershell-cannot-handle-a-remote-session-might-have-ended/5764707 "2026-07-28T18:19:23Z")

</div>

Bonjour à tous. Depuis hier soir, quelques-uns de mes projets qui utilisent la même activité Invoke Power Shell au début échouent lorsqu'ils sont exécutés via Assistant, et après une enquête aujourd'hui, il semble que ce soit un i…

---

## [Cartographie du lecteur réseau - Problèmes récurrents](https://forum.uipath.com/t/mapping-network-drive-consistent-issues/5759045)

<div class="topic-metadata">

**Author:** [@chowden](https://forum.uipath.com/u/chowden)\
**Réponses:** 3\
**Dernière mise à jour :** [Juillet 7, 2026, 2:54 UTC](https://forum.uipath.com/t/mapping-network-drive-consistent-issues/5759045 "2026-07-07T14:54:30Z")

</div>

Dans notre configuration, le robot se connecte à une machine virtuelle Win11 avec son compte principal, puis dispose de vos identifiants spécifiques au processus pour effectuer des automatismes. Pour mapper des lecteurs réseau qui ne peuvent être accessibles que par le processus…

---

## [Comment exécuter une requête PowerShell dans Studio](https://forum.uipath.com/t/how-to-run-powershell-query-in-studio/5724528)

<div class="topic-metadata">

**Author:** [@Mathkar\_kunal](https://forum.uipath.com/u/Mathkar_kunal)\
**Réponses:** 2\
**Dernière mise à jour :** [Février 27, 2026, 2:32 UTC](https://forum.uipath.com/t/how-to-run-powershell-query-in-studio/5724528 "2026-02-27T14:32:21Z")

</div>

Bonjour, j’ai la requête cmd suivante : dsquery \* domainroot -filter “(&(objectCategory=User)(sAMAccountName=“kmathkar”))” -attr cn Elle fonctionne dans cmd et aussi en ouvrant cmd avec UiPath, mais le problème survient lorsque je suis…

---

## [Comment écrire la commande /pass dans PowerShell](https://forum.uipath.com/t/how-to-write-pass-command-in-invoke-power-shell/5724334)

<div class="topic-metadata">

**Author:** [@Mathkar\_kunal](https://forum.uipath.com/u/Mathkar_kunal)\
**Réponses:** 5\
**Dernière mise à jour :** [Février 27, 2026, 6:05 UTC](https://forum.uipath.com/t/how-to-write-pass-command-in-invoke-power-shell/5724334 "2026-02-27T06:05:16Z")

</div>

Bonjour, je ne veux pas ouvrir cmd et saisir une commande avec UiPath. Je veux plutôt l’exécuter directement avec Invoke PowerShell et récupérer le résultat. Supposons que ma commande soit -xyz. Comment puis-je la transmettre directement à Invoke PowerShell ?

---

## [Comment appeler un script Python dans UiPath avec l’activité Invoke Code ?](https://forum.uipath.com/t/how-to-invoke-a-python-script-in-uipath-using-invoke-code-activity/2856425)

<div class="topic-metadata">

**Author:** [@voranir](https://forum.uipath.com/u/voranir)\
**Réponses:** 10\
**Dernière mise à jour :** [Juin 19, 2025, 8:57 UTC](https://forum.uipath.com/t/how-to-invoke-a-python-script-in-uipath-using-invoke-code-activity/2856425 "2025-06-19T20:57:45Z")

</div>

Bonjour, Je souhaite exécuter un script Python avec des paramètres d’entrée (chaîne de caractères, entier, etc.). Comment faire avec l’activité Invoke Powershell dans UiPath ? J’utilise la dernière version de Python et je ne veux pas utiliser Invoke Python s…

---

## [Powershell command to choose default apps by file type?](https://forum.uipath.com/t/powershell-command-to-choose-default-apps-by-file-type/716202)

<div class="topic-metadata">

**Author:** [@rishiathawale](https://forum.uipath.com/u/rishiathawale)\
**Réponses:** 2\
**Dernière mise à jour :** [Mars 18, 2025, 7:13 UTC](https://forum.uipath.com/t/powershell-command-to-choose-default-apps-by-file-type/716202 "2025-03-18T07:13:05Z")

</div>

Hi All, By default the .CSV file is getting opened in Excel file. I want to change the by default app for .CSV to Notepad and vice versa Want to perform this action at the start of bot and end of bot using powershe…

---

## [「PowerShellの呼び出し」アクティビティのエラー](https://forum.uipath.com/t/powershell/716237)

<div class="topic-metadata">

**Author:** [@furukawa\_h](https://forum.uipath.com/u/furukawa_h)\
**Réponses:** 5\
**Dernière mise à jour :** [Février 8, 2024, 2:47 UTC](https://forum.uipath.com/t/powershell/716237 "2024-02-08T02:47:10Z")

</div>

OSバージョンを「Windows-レガシ」から「Windows」に変換する機能を利用したのですが、 以下のエラーが発生してしまいます。 対処方法についてご存じの方がいらっしゃいましたら、教えてください。 ■事象 レガシープロジェクトからWindowsプロジェクトに変換後、「PowerShellの呼び出し」アクティビティでエラーが発生する。 ■エラー内容 “message”: “PowerShell を呼び出し: The ‘E…

---

## [Invoke power shell issue, want to map network drive with credentials](https://forum.uipath.com/t/invoke-power-shell-issue-want-to-map-network-drive-with-credentials/569172)

<div class="topic-metadata">

**Author:** [@Matt67](https://forum.uipath.com/u/Matt67)\
**Réponses:** 6\
**Dernière mise à jour :** [Janvier 8, 2024, 2:55 UTC](https://forum.uipath.com/t/invoke-power-shell-issue-want-to-map-network-drive-with-credentials/569172 "2024-01-08T14:55:57Z")

</div>

Hello, I try to map network drive dynamically with credentials taken from orchestrator ( Get Credential activity ) for security purposes. I have Invoke Power shell activity in Windows project and put this inside $dri…

---

## ["Invoke Power Shell: Cannot retrieve the dynamic parameters for the cmdlet."](https://forum.uipath.com/t/invoke-power-shell-cannot-retrieve-the-dynamic-parameters-for-the-cmdlet/671571)

<div class="topic-metadata">

**Author:** [@pere](https://forum.uipath.com/u/pere)\
**Réponses:** 1\
**Dernière mise à jour :** [Janvier 4, 2024, 11:05 UTC](https://forum.uipath.com/t/invoke-power-shell-cannot-retrieve-the-dynamic-parameters-for-the-cmdlet/671571 "2024-01-04T11:05:13Z")

</div>

I’m attaching a project with a whole number of different commands that will fail. The last one, “Set-PSRepository”, that will throw a "Invoke Power Shell: Cannot retrieve the dynamic parameters for the cmdlet. The t…

---

## [Invoke Power Shell with command "Get-PSRepository" throws unrelated? error](https://forum.uipath.com/t/invoke-power-shell-with-command-get-psrepository-throws-unrelated-error/671545)

<div class="topic-metadata">

**Author:** [@pere](https://forum.uipath.com/u/pere)\
**Réponses:** 1\
**Dernière mise à jour :** [Janvier 4, 2024, 10:57 UTC](https://forum.uipath.com/t/invoke-power-shell-with-command-get-psrepository-throws-unrelated-error/671545 "2024-01-04T10:57:22Z")

</div>

Look at the attached screenshot. Trying to run “Get-PSRepository” without any parameters trows this error: Invoke Power Shell: The term ‘PackageManagement\\Get-PackageSource’ is not recognized as a name of a cmdlet, fu…

---

## [Invoke Power Shell activity randomly missing buttons on the command input text box](https://forum.uipath.com/t/invoke-power-shell-activity-randomly-missing-buttons-on-the-command-input-text-box/649511)

<div class="topic-metadata">

**Author:** [@pere](https://forum.uipath.com/u/pere)\
**Réponses:** 1\
**Dernière mise à jour :** [Janvier 4, 2024, 10:47 UTC](https://forum.uipath.com/t/invoke-power-shell-activity-randomly-missing-buttons-on-the-command-input-text-box/649511 "2024-01-04T10:47:17Z")

</div>

At least in this activity (in could be happening with other activities, also), some controls for opening the big text editor (“\<\>”) or for choosing a variable (“+”) for the “Command” input text box randomly are present o…

---

## [Invoke PowerShell with ActiveDirectory module not working](https://forum.uipath.com/t/invoke-powershell-with-activedirectory-module-not-working/497509)

<div class="topic-metadata">

**Author:** [@Daniel\_Caldararu](https://forum.uipath.com/u/Daniel_Caldararu)\
**Réponses:** 6\
**Dernière mise à jour :** [Décembre 19, 2022, 1:48 UTC](https://forum.uipath.com/t/invoke-powershell-with-activedirectory-module-not-working/497509 "2022-12-19T13:48:14Z")

</div>

Hello, I’m trying to interrogate a user on AD by using the activity Invoke Power Shell but without any luck. If I try to apply this command under PowerShell directly it will work (after I import or will auto-import once…

---

## [Invoke Powershell Activity stays in Running state](https://forum.uipath.com/t/invoke-powershell-activity-stays-in-running-state/615361)

<div class="topic-metadata">

**Author:** [@Tusharkanta\_Panda](https://forum.uipath.com/u/Tusharkanta_Panda)\
**Réponses:** 1\
**Dernière mise à jour :** [Octobre 2, 2023, 9:02 UTC](https://forum.uipath.com/t/invoke-powershell-activity-stays-in-running-state/615361 "2023-10-02T09:02:34Z")

</div>

I am using this script below to imitate a flexible save file scenario and the code works fine in PowerShell console, but when I am trying to run it through invoke PowerShell activity it keeps on running without any outpu…

---

## [Casting Type Error](https://forum.uipath.com/t/casting-type-error/534140)

<div class="topic-metadata">

**Author:** [@john.mari](https://forum.uipath.com/u/john.mari)\
**Réponses:** 9\
**Dernière mise à jour :** [Juillet 31, 2023, 3:25 UTC](https://forum.uipath.com/t/casting-type-error/534140 "2023-07-31T15:25:14Z")

</div>

Hi, I am using Invoke Powershell activity to Connect Teams and retrieve unassigned telephone number. But, while running the code I am facing a type casting error says: Invoke Power Shell: Unable to cast object of type…

---

## [Set automatic reply on mailbox using Powershell set-mailboxautoreplyconfiguration cmdlet](https://forum.uipath.com/t/set-automatic-reply-on-mailbox-using-powershell-set-mailboxautoreplyconfiguration-cmdlet/562879)

<div class="topic-metadata">

**Author:** [@r.wall](https://forum.uipath.com/u/r.wall)\
**Réponses:** 0\
**Dernière mise à jour :** [Juillet 13, 2023, 12:33 UTC](https://forum.uipath.com/t/set-automatic-reply-on-mailbox-using-powershell-set-mailboxautoreplyconfiguration-cmdlet/562879 "2023-07-13T00:33:20Z")

</div>

Hello, I’m trying to set and out of office reply on a mailbox using the following powershell script in UiPath: import module exchange online try { Import-Module ExchangeOnlineManagement $Message = “ExchangeOnline m…

---

## [Invoke Power Shell: Unable to cast object to type 'System.IO.FileInfo' to type 'System.String'](https://forum.uipath.com/t/invoke-power-shell-unable-to-cast-object-to-type-system-io-fileinfo-to-type-system-string/547336)

<div class="topic-metadata">

**Author:** [@Suraj\_Soman](https://forum.uipath.com/u/Suraj_Soman)\
**Réponses:** 1\
**Dernière mise à jour :** [Mai 23, 2023, 4:33 UTC](https://forum.uipath.com/t/invoke-power-shell-unable-to-cast-object-to-type-system-io-fileinfo-to-type-system-string/547336 "2023-05-23T04:33:16Z")

</div>

Hi, I was using ‘Invoke Power Shell’ activity, it works fine most of the times, but sometimes it throws any of the below three error messages. Invoke Power Shell: Unable to cast object to type ‘System.IO.FileInfo’ to …

---

## [How to install and call Powershell Module in 2023.4 vs older version?](https://forum.uipath.com/t/how-to-install-and-call-powershell-module-in-2023-4-vs-older-version/545045)

<div class="topic-metadata">

**Author:** [@tomas.monsen.mtg](https://forum.uipath.com/u/tomas.monsen.mtg)\
**Réponses:** 1\
**Dernière mise à jour :** [Mai 15, 2023, 3:11 UTC](https://forum.uipath.com/t/how-to-install-and-call-powershell-module-in-2023-4-vs-older-version/545045 "2023-05-15T15:11:18Z")

</div>

Hello I have recently upgraded to Studio 2023.4. After this, my Invoke-Powershell does not work. I have Powershell 5.x on my machine. In this version I have installed module PnP.PowerShell using “Install-Module” and s…

---

## [Invoke Power Shell returns wrong encoding value](https://forum.uipath.com/t/invoke-power-shell-returns-wrong-encoding-value/543110)

<div class="topic-metadata">

**Author:** [@PythonDev85](https://forum.uipath.com/u/PythonDev85)\
**Réponses:** 10\
**Dernière mise à jour :** [Mai 15, 2023, 9:42 UTC](https://forum.uipath.com/t/invoke-power-shell-returns-wrong-encoding-value/543110 "2023-05-15T09:42:19Z")

</div>

Hi, I’m using an Invoke Power Shell activity to run a Python script. This script outputs multiple values that I have to use in a For Each activity later on. Everything works fine, except one detail : I get the wrong en…

---

## [Issue with Writing Logs to File Using the 'Invoke PowerShell' Activity in UiPath](https://forum.uipath.com/t/issue-with-writing-logs-to-file-using-the-invoke-powershell-activity-in-uipath/525106)

<div class="topic-metadata">

**Author:** [@Tuannna1](https://forum.uipath.com/u/Tuannna1)\
**Réponses:** 4\
**Dernière mise à jour :** [Mars 11, 2023, 7:27 UTC](https://forum.uipath.com/t/issue-with-writing-logs-to-file-using-the-invoke-powershell-activity-in-uipath/525106 "2023-03-11T07:27:12Z")

</div>

Hi everyone, @Yoichi I am trying to write logs to a file when using the “Invoke PowerShell” activity, but I have not been successful so far. $logFilePath = "E:\\Test\\log.txt" $FolderPath = "E:\\UiPath" Start-Transcript…

---

## [How To Execute PowerShell Script with Dynamic Variables](https://forum.uipath.com/t/how-to-execute-powershell-script-with-dynamic-variables/493391)

<div class="topic-metadata">

**Author:** [@Zehra](https://forum.uipath.com/u/Zehra)\
**Réponses:** 3\
**Dernière mise à jour :** [Décembre 2, 2022, 6:30 UTC](https://forum.uipath.com/t/how-to-execute-powershell-script-with-dynamic-variables/493391 "2022-12-02T06:30:33Z")

</div>

Hello everyone, I have two dynamic variables, I want to use invoke powershell activity as an anternative way of active directory acitivities how can I run this script in UiPath invoke powershell activity? Do you have a…

---

## [Getting following error while trying to run the process (Process attached). This was working fine when I created it, after reopening it is giving error. Anyone faced such issue before?](https://forum.uipath.com/t/getting-following-error-while-trying-to-run-the-process-process-attached-this-was-working-fine-when-i-created-it-after-reopening-it-is-giving-error-anyone-faced-such-issue-before/489232)

<div class="topic-metadata">

**Author:** [@Harsha\_Tiwari](https://forum.uipath.com/u/Harsha_Tiwari)\
**Réponses:** 4\
**Dernière mise à jour :** [Novembre 11, 2022, 8:14 UTC](https://forum.uipath.com/t/getting-following-error-while-trying-to-run-the-process-process-attached-this-was-working-fine-when-i-created-it-after-reopening-it-is-giving-error-anyone-faced-such-issue-before/489232 "2022-11-11T08:14:07Z")

</div>

Error ERROR Validation Error System.ArgumentException: Property ‘System.String ServiceName’ is not defined for type ‘System.ServiceProcess.ServiceController’ (Parameter ‘property’) Invoke PS.zip (2.5 KB)

---

## [Invoke Power Shell Windows long path prefix Bug](https://forum.uipath.com/t/invoke-power-shell-windows-long-path-prefix-bug/451288)

<div class="topic-metadata">

**Author:** [@MarekBruna](https://forum.uipath.com/u/MarekBruna)\
**Réponses:** 11\
**Dernière mise à jour :** [Septembre 3, 2022, 9:29 UTC](https://forum.uipath.com/t/invoke-power-shell-windows-long-path-prefix-bug/451288 "2022-09-03T09:29:20Z")

</div>

Windows has a path length limit of 260 characters a workaround for this is to use a \\\\?\\ prefix. Such a prefix works when using a regular PowerShell however using it in UiPath’s Invoke Power Shell activity it doesn’t see…

---

## [Run Powershell in UiPath by Oauth 2.0 to perform actions in Exchange online](https://forum.uipath.com/t/run-powershell-in-uipath-by-oauth-2-0-to-perform-actions-in-exchange-online/460670)

<div class="topic-metadata">

**Author:** [@ShekharRPA](https://forum.uipath.com/u/ShekharRPA)\
**Réponses:** 0\
**Dernière mise à jour :** [Juillet 29, 2022, 8:28 UTC](https://forum.uipath.com/t/run-powershell-in-uipath-by-oauth-2-0-to-perform-actions-in-exchange-online/460670 "2022-07-29T08:28:30Z")

</div>

Hi Everyone, As we all know, Basic oauth 2.0 authentication is soon disable by Microsoft. Some of the projects i am using it to run in PowerShell. Now i want to use Oauth 2.0 to replace the basic auth. I extracted Clien…

---

## [PowerShell acticity does not return out Argument](https://forum.uipath.com/t/powershell-acticity-does-not-return-out-argument/443892)

<div class="topic-metadata">

**Author:** [@loirdiahmed](https://forum.uipath.com/u/loirdiahmed)\
**Réponses:** 2\
**Dernière mise à jour :** [Mai 30, 2022, 7:21 UTC](https://forum.uipath.com/t/powershell-acticity-does-not-return-out-argument/443892 "2022-05-30T19:21:07Z")

</div>

Hi Everyone, I try to get a status from my script by calling the variable in Invoke PowerShell activity in PowerShellVariables pannel. In Powershell script the variable is named “Status” and in UiPath it is named “Stat…

---

## [Running powershell script as different user](https://forum.uipath.com/t/running-powershell-script-as-different-user/385568)

<div class="topic-metadata">

**Author:** [@Aditi\_Pareek1](https://forum.uipath.com/u/Aditi_Pareek1)\
**Réponses:** 2\
**Dernière mise à jour :** [Décembre 27, 2021, 5:29 UTC](https://forum.uipath.com/t/running-powershell-script-as-different-user/385568 "2021-12-27T05:29:48Z")

</div>

How can I run powershell script as different user in UiPath

---

## [HOw to run power query from uipath](https://forum.uipath.com/t/how-to-run-power-query-from-uipath/381058)

<div class="topic-metadata">

**Author:** [@bpt.teja1996](https://forum.uipath.com/u/bpt.teja1996)\
**Réponses:** 1\
**Dernière mise à jour :** [Décembre 22, 2021, 4:02 UTC](https://forum.uipath.com/t/how-to-run-power-query-from-uipath/381058 "2021-12-22T16:02:44Z")

</div>

Hi all i have a Powerquery which will be executed manually now i need to execute that poer query using uipath how can we execute power query using uipath on excel

---

## [How to kill a process for current user with one line power shell code](https://forum.uipath.com/t/how-to-kill-a-process-for-current-user-with-one-line-power-shell-code/362602)

<div class="topic-metadata">

**Author:** [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Réponses:** 0\
**Dernière mise à jour :** [Novembre 18, 2021, 12:56 UTC](https://forum.uipath.com/t/how-to-kill-a-process-for-current-user-with-one-line-power-shell-code/362602 "2021-11-18T12:56:28Z")

</div>

SCENARIO KILL PROCESS - plays a major role in all the enterprise level workflows especially with the process built using REFramework template, where we have a separate workflow either to kill all the open application. I…

---

## [Invoke Power Shell: This command cannot be run due to the error: The directory name is invalid](https://forum.uipath.com/t/invoke-power-shell-this-command-cannot-be-run-due-to-the-error-the-directory-name-is-invalid/327506)

<div class="topic-metadata">

**Author:** [@Mitchal\_Brown\_OMG](https://forum.uipath.com/u/Mitchal_Brown_OMG)\
**Réponses:** 3\
**Dernière mise à jour :** [Juillet 6, 2021, 10:49 UTC](https://forum.uipath.com/t/invoke-power-shell-this-command-cannot-be-run-due-to-the-error-the-directory-name-is-invalid/327506 "2021-07-06T22:49:52Z")

</div>

Hi all, I’m currently writing an automation that pulls data from a queue (an email address) and uses it as a parameter in a PowerShell script to update a security group. The PowerShell script needs to be run as a servic…

---

## [Unable to connect to remote server - HTTps activity or invoke powershell activity](https://forum.uipath.com/t/unable-to-connect-to-remote-server-https-activity-or-invoke-powershell-activity/314519)

<div class="topic-metadata">

**Author:** [@vikaram\_viki](https://forum.uipath.com/u/vikaram_viki)\
**Réponses:** 0\
**Dernière mise à jour :** [Mai 12, 2021, 12:27 UTC](https://forum.uipath.com/t/unable-to-connect-to-remote-server-https-activity-or-invoke-powershell-activity/314519 "2021-05-12T12:27:57Z")

</div>

For few URls getting response as unable to connect to remote server using HTTps activity or invoke powershell activity in UiPath why?? how to handle this issue
