Skip to main content

Notifications

Business Central forum
Suggested answer

Call PowerShell script with parameters from BC Page

Posted on by 29
Hi All,

I am working on a custom solution to call a Powershell script which is located on the BC Server (OnPrem) where variables from the BC have to be sent to the Powershell script. Soluiton is desinged like this:
I need to know how to pass a variable to the Powershell script, and how to return some text from Powershell to the BC, and I would like to avoid the PowerAutomate, since my client uses BC23 OnPrem, If outherwise not possible, I will then use PowerAutomate flow to call the PS script.
 
1. user opens Customer Card
2. user clicks on a button (action item) "Create Folder"
3. RestAPI ia called to execute the PS file located on the BC Server, where the parameter (CustomerNo) has to be passed to the Powershell script.
4. Powrshell is executed
5. parameter of complete file path is passed from the Powershell script to the Customer Card. 


Any ideas are welcomed.
 
Thanks Damjan
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 71,232 Super User 2024 Season 2 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,807 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans