# 「PowerShellを呼び出し」 のアクティビティでエラー

**URL:** <https://forum.uipath.com/t/powershell/508081>\
**Category:** フォーラム\
**Tags:** studio, activities\
**Created:** [January 17, 2023, 7:26am UTC](https://forum.uipath.com/t/powershell/508081 "2023-01-17T07:26:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasano](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jasano/32/177284_2.png) [@jasano](https://forum.uipath.com/u/jasano)\
**Post date:** [January 17, 2023, 7:26am UTC](https://forum.uipath.com/t/powershell/508081/1 "2023-01-17T07:26:44Z")

</div>

「PowerShellを呼び出し」のアクティビティが、急に使えなくなりました。  
以下の2件と似ているように思えますが、一緒でしょうか？しかし、モダンデザインにしても実行できませんでした。

> [@Windowsレガシからwindowsに変換したら「チェック」が使えなくなった](https://forum.uipath.com/t/windows-windows/504991):
>
> windowsレガシからwindowsに変換してしまったら、 次のエラーが出るようになってしまいました。 Error ERROR 検証エラー 名前が ‘Constraint’ の制約を名前が ‘Sequence’ の型 System.Activities.Statements.Sequence のアクティビティに対して実行しているときに内部制約例外が発生しました。例外: System.NullReferenceException: Object reference not set to an instance of an object. at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout) at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictio…

> [@Check Activity Error](https://forum.uipath.com/t/check-activity-error/504715):
>
> After updating UiPath to the latest version 2022.12 (Dec) Beta I gotten this error when using the “Check” Activity checkbox. Please assist I unable to rollback to previous UiPath version.

エラーメッセージは以下の通りです。

> Error ERROR 検証エラー 名前が ‘Constraint’ の制約を名前が ‘Sequence’ の型 System.Activities.Statements.Sequence のアクティビティに対して実行しているときに内部制約例外が発生しました。例外: System.NullReferenceException: Object reference not set to an instance of an object.  
> at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout) at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)  
> at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs) at System.Activities.Validation.ActivityValidationServices.RunConstraints(ChildActivity childActivity, ActivityCallStack parentChain, IList`1 constraints, ProcessActivityTreeOptions options, Boolean suppressGetChildrenViolations, IList`1& validationErrors) Main.xaml

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 17, 2023, 7:53am UTC](https://forum.uipath.com/t/powershell/508081/2 "2023-01-17T07:53:10Z")

</div>

こんにちは

下記POSTと同じですね．．。

> [@Validation Error While Compiling in Uipath Beta](https://forum.uipath.com/t/validation-error-while-compiling-in-uipath-beta/501064/5):
>
> The issue is with the powershell snippet. There is no workaround - the current UiPath version has broken all my workflows.

試すとすれば、System.Activities packageを最新にした上で、InvokePowershellアクティビティを置き換えなおしてみるあたりでしょうか。

---

<div class="post-metadata">

**Author:** ![jasano](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jasano/32/177284_2.png) [@jasano](https://forum.uipath.com/u/jasano)\
**Post date:** [January 18, 2023, 8:22am UTC](https://forum.uipath.com/t/powershell/508081/3 "2023-01-18T08:22:01Z")

</div>

回答有難うございます。  
InvokePowershellアクティビティの代替としてStartProccessアクティビティを使用すると実行可能なようですが、正直、それではInvokePowershellアクティビティの存在意義を否定するような気がしています。  
１）これらのアクティビティの差は、置き換えても別に違いはない、と言う程度ものでしょうか…？  
２）UiPathの次回更新で修正予定があったりするでしょうか？（その場合いつでしょうか？）

※クローズされて新規投稿が許されないのでこちらに追記。  
2023/03/01 バージョン 23.2.0-beta.11986 にアップデート：本件解消されませんでした。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 18, 2023, 8:58am UTC](https://forum.uipath.com/t/powershell/508081/4 "2023-01-18T08:58:32Z")

</div>

こんにちは

> [@jasano](#):
>
> １）これらのアクティビティの差は、置き換えても別に違いはない、と言う程度ものでしょうか…？

StartProcessは単にプロセスを実行するアクティビティですので、できることが多い反面、面倒なことも多いです。  
例えばInvokePowerShellですと、呼び出すPowerShellの32bit/64bitは、UiPath側の実行プロセスに引っ張られます（WindowsLegacyだと32bit,Windowsですと64bit）が、StartProcessですと、 **適切に設定すれば** 使い分けることができます。当然呼び出すexeや渡すオプションも適切にする必要がありますので、このあたりが適切にできない方にとってはハードルが高いと思います。  
実現できることが同じであれば、置き換えても問題はないと思います。

> ２）UiPathの次回更新で修正予定があったりするでしょうか？（その場合いつでしょうか？）

これは中の人しかわからないですね。

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [January 21, 2023, 8:59am UTC](https://forum.uipath.com/t/powershell/508081/5 "2023-01-21T08:59:04Z")

</div>

Closed on January 21, 2023, 8:59am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
