View Single Post
Old 2nd September 2016, 05:45   #11
Chaitanyansis
Junior Member
 
Join Date: Aug 2016
Posts: 14
Quote:
Originally Posted by th_mi View Post
I tested it, for me it worked perfectly exactly the way I described. I used the script I posted here and also the exec call. The only thing I did was addeng the path to the powershell.exe and also to the test.ps1.

It worked as expected!
Hi th_mi when we are writing with out a function it is working fine but when I create the script as follows it didn't worked for me

function CallMe
{
Param([Parameter(Mandatory=$False)][string]$param1="")

Write-host "Parameter: $param1"
}

This is working fine

Param([Parameter(Mandatory=$False)][string]$param1="")

Write-host "Parameter: $param1"
Chaitanyansis is offline   Reply With Quote