Hi guys,
Sorry if this was answered before (couldn't find it any)
For some reason after I powershell.addscript, my addparameter doesn't seem to be working:
#hello.ps1
param(
[string]$thingToWrite
)
$helloLog = [System.IO.StreamWriter]"c:\files\hellolog.txt"
$helloLog.WriteLine( $thingToWrite)
$helloLog.Close()
#run-hello.ps1
$p = [Powershell]::Create()
$p.AddScript("C:\files\hello.ps1")
$p.AddParameter("thingToWrite","write this")
$p.Invoke()
My parameter is always blank. I've tried different approaches and searched various forums, but can't seem to figure it out yet. Any help at all will be greatly appreciated!!