Running this script…
$erroractionpreference = “Stop”
$servers = Get-Content -path C:\symantecinstallation\reports\WEBDEV.csv
foreach ($server in $servers){
$server
$os = (Get-WmiObject -computername $server -class Win32_OperatingSystem ).osarchitecture
If ($os -eq “64-bit”) {
Write-host "running 64 $server"
$arSourceFolders1 = ("\\snappsepp03s\sep_clients\msi\My Company_2 Mid-West_Servers_STL_Co-Lo_Web Dev Servers_WIN64BIT_Server\Symantec Endpoint Protection version 12.1.2015.2015 - English")
$arDestinationFolders1 = ("\\$server\C$\Windows\Temp\Symantec Endpoint Protection version 12.1.2015.2015 - English")
$cmd1 = robocopy $arSourceFolders1 $arDestinationFolders1 /MIR /XA:SH /ipg:0 /w:0 /log:c:\symantecInstallation\robocopy\robocopy_"$server"log.txt
start-process $cmd1 -Wait
Write-Host "Copy 64bit Symantec Install Complete $server"
Invoke-Command -Computername $server -ScriptBlock {
$msifile= 'msiexec /i C:\windows\temp\Symantec Endpoint Protection version 12.1.2015.2015 - English\sep64.msi'
$arguments= ' /qn SYMREBOOT=ReallySuppress /l*v C:\windows\Temp\sep.log'
Start-Process `
-file $msifile `
-arg $arguments `
-passthru | wait-process}
I get the following error?
Start-Process : Cannot convert ‘System.Object’ to the type ‘System.String’ required by parameter ‘FilePath’. Specified method is not supported.
At C:\SymantecInstallation\Symantecinstallerworkinprogress.ps1:11 char:16
- start-process $cmd1 -Wait
-
~~~~~- CategoryInfo : InvalidArgument: (
[Start-Process], ParentContainsErrorRecordException - FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.StartProcessCommand
- CategoryInfo : InvalidArgument: (
though the copy command is working?