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) 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -