Install software using powershell script -


i trying install notepad++ software using powershell v2.0 script 1 of poc. need install client's softwares in current project. running below script getting errors.

start-process 'c:\users\kirnen\desktop\a\npp.7.5.installer.exe' -installerparameters "/s" -registrykey hklm:\software\wow6432node\microsoft\windows\currentversion\uninstall\notepad++ -registryname displayversion -registryvalue 7.5

as new powershell scripting.

can please in this. above code right or need change else install software.

i use snippet of powershell code lot of installs. long can figure out silent switch ".exe's". ".msi's" change out create() create("msiexec /i c:\temp\generic.msi /qn")

$computers = c:\temp\computername.csv $notepad = "location of notepad install

$computers | where{test-connection $_ -quiet -count 1} | foreach-object{

copy-item $notepad -recurse "\$_\c$\temp"

$newproc=([wmiclass]"\$_\root\cimv2:win32_process").create("c:\temp\npp.6.9.2.installer.exe /s")

if ($newproc.returnvalue -eq 0) { write-host $_ $newproc.processid } else { write-host $_ process create failed $newproc.returnvalue } }


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -