View Single Post
Old 30th August 2016, 14:10   #6
th_mi
Member
 
Join Date: Sep 2005
Location: Sitting next to my desk
Posts: 56
Hello Chaitanyansis

In your case I'd try the followerd. I only explain how it could work, not the NSIS stuff.

Assuming you have the followed ps1 script (do not use in this case psm1 since you need to use import-module. If you have a psm1 you shoudl handle this in the ps1 script you call.

Script test.ps1:
Param([Parameter(Mandatory=$False)][string]$param1="",
[Parameter(Mandatory=$False)][string]$param2="")

Write-host "Parameter: $param1 $param2"

How to call the script from normal command prompt:
powershell -file test.ps1 -param1 1 -param2 2

The result would be:
Parameter: 1 2

This signature is currently on vacation!
th_mi is offline   Reply With Quote