powershell script gives an error when script from wixtool set installer

nikhil mate 1 Reputation point
2022-12-08T04:03:09.32+00:00

when I run the powershell script from installer it gives an error
here what I did to run the script
SetProperty Id="PS1"
Before="InstallFiles"
Sequence="execute"
Value =""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"-NoLogo -NonInteractive -ExecutionPolicy Bypass -InputFormat None -NoProfile -File"cd '[wsltooling]'; & '[#ps1]' "" />

<CustomAction Id="PS1" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="deferred" Return="check" Impersonate="no" />

error this is giving 268467-image-1.png

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,724 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue 37,276 Reputation points Microsoft Vendor
    2022-12-12T03:02:31.19+00:00

    Hi,

    Please see if -File &quot;'[#ps1]' &quot; works. The "-file" parameter only accepts the script file path.

    Best Regards,
    Ian Xue

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.