Open document with exe of Sapien PS Studio

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Open document with exe of Sapien PS Studio

Post by stevens »

Thanks!

Tested this by creating an exe, then dragging MySoft.msi to the exe.
This is the output/error:

ERROR: Cannot convert value ""C:\Users\MyUser\Desktop\MySoft.msi"" to type "System.IO.DirectoryInfo". Error: "Illegal
ERROR: characters in path."
ERROR: At line:75 char:3
ERROR: + $global:file = [system.io.directoryinfo]$commandarg
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : InvalidArgument: (:) [], RuntimeException
ERROR: + FullyQualifiedErrorId : InvalidCastConstructorException
ERROR:
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Open document with exe of Sapien PS Studio

Post by stevens »

This seems to work! :-)

$commandargFormatted = $commandarg -replace ('"','')
$global:file = [system.io.directoryinfo]$commandargFormatted
This topic is 4 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked