windows - Problems writing a WSUS-Program in AutoIt using Powershell -
i new wsus, powershell , autoit. writing program approve multiple updates few clicks (instead of 5 clicks per update , group). therefore have powershell-script searches computer-groups , available updates.
the scripts aher working, have problems calling them in autoit (as found out, have import module updateservices can´t working).
here 1 part of autoit-program:
$scomsend = '-executionpolicy bypass import-module updateservices; ' & $sscript & '\search_updates.ps1 -filepath ' & $supdateoutput shellexecutewait("powershell.exe", $scomsend)
but doesn´t work. try this:
$scomsend = 'powershell.exe import-module updateservices; "-executionpolicy bypass ' & $sscript & '\search_updates.ps1 -filepath ' & $supdateoutput & '"' runwait(@comspec & " /c " & $scomsend, "", @sw_show , $stdout_child)
but didn´t work. honest, in second one, don´t know of these parameters mean. see mistake?
thanks :-)
i suggest keep simple.
create new powershell file called "mystuff.ps1", , in there, put:
param([string]$filepath) import-module updateservices write-host "filepath = $filepath"
after done, invoke it:
$filelocation = "c:\myabsolutepath\mystuff.ps1" $arguments = '-filepath "c:\testing 1 2 three"' $commandline = '-windowstyle normal -noexit -nologo -noprofile -command & "' & $filelocation & '" ' & $arguments run($commandline, @systemdir, @sw_show , $stdout_child)