EXE with Exchange powershell

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
userausera
Posts: 2
Joined: Tue Aug 27, 2019 11:07 am

EXE with Exchange powershell

Post by userausera » Tue Aug 27, 2019 11:18 am

Greeting

Product, version and build: Studio

Have a question for studio.

I have a development windows 10 machine with Microsoft exchange Powershell installed, the script working no any issues.

if I compile it to an EXE file, it will works on this development machine no issue.

But if the TARGET machine is a normal windows 10 machine, say clean new installed (for sure no Microsoft exchange powershell installed). Can I still run that EXE file without issue?

Thanks and Best Regards,
usera

User avatar
Alexander Riedel
Posts: 7051
Joined: Tue May 29, 2007 4:43 pm

Re: EXE with Exchange powershell

Post by Alexander Riedel » Tue Aug 27, 2019 11:34 am

No, it will not work. Its not compiler, its a packager. Any dependencies you have must also exist on the target machine.
The underlying mechanism is still PowerShell, so any snapins, modules etc you use must be present.
Alexander Riedel
SAPIEN Technologies, Inc.

userausera
Posts: 2
Joined: Tue Aug 27, 2019 11:07 am

Re: EXE with Exchange powershell

Post by userausera » Tue Aug 27, 2019 11:58 am

Thanks Alexander,

Any workaround base on using studio.

Usera

User avatar
Alexander Riedel
Posts: 7051
Joined: Tue May 29, 2007 4:43 pm

Re: EXE with Exchange powershell

Post by Alexander Riedel » Wed Aug 28, 2019 2:29 am

Three ways this is usually done.

1. You create one script and package it as an executable that checks if all the stuff you need is there. If yes, it launches the main application.
This way you check every time the application is launched. If something is missing, you launch the appropriate installer(s) from your network or the internet.

2. You create an MSI with PowerShell Studio to properly install your application. In a custom action you check if what you need is there and if not, you install it.
The check for prerequisites in only on install that way.

3. Your script in your application checks in the beginning if all what is needed is present. If not display an error with instructions for the user what to do and fail gracefully.
Alexander Riedel
SAPIEN Technologies, Inc.