1 (изменено: inseption86, 2019-04-07 10:58:47)

Тема: PS:Start-Process

Добрый день!! Shell имеет вид  - "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --incognito --disable-restore-session-state --kiosk printing https://yandex.ru
На удалённых ПК сайты разные, возможно ли запустить на удалённой машине параметр shell? Заранее спасибо!


$computername = 'namecomp1' , 'namecomp2' 
foreach ($computer in $computername)
{
    $result = Invoke-Command -ComputerName $computer  { (Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon'-Name Shell).Shell  } 
   $result = ([regex]'(--kiosk.+)').Replace($result,' "$1"')   
    Invoke-Command -ComputerName $computer {Start-Process $result}
}