!include "x64.nsh" Name "nsExec Test" OutFile "nsExecTest.exe" #ShowInstDetails show Section "Output to variable" nsExec::ExecToStack 'powershell.exe "& "Import-Module C:\PowerShell\Hello.ps1"' Pop $0 Pop $1 DetailPrint '"ImportModules" printed: $1' SectionEnd
# Filename: Hello.psm1 Write-Host Write-Host 'Hello World!' Write-Host "Good-bye World! `n" # end of script
# Filename: Hello.ps1 function TestParam([string] $TestParam) { Write-Host Write-Host '$TestParam' Write-Host "Good-bye $TestParam! `n" } # end of script
nsExec::ExecWait "powershell -File C:\Dorababu\PowerShell\testparam1.ps1 -param1 'Hello'"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)