0

I try to realize a Gui with psexec and powershell, and my first step is to execute file so I have a button to select file :

 $button2_OnClick= 
{
    $global:OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
    $global:OpenFileDialog.initialDirectory = $initialDirectory
    $global:OpenFileDialog.ShowDialog()
    write-host $global:OpenFileDialog.FileName
}

And another to execute psexec

$button1_OnClick= 
{
        Start-Process -FilePath "C:\Temp\PsExec.exe" -ArgumentList "/Accepteula -c \\<ComputerName> $global:OpenFileDialog.FileName" -Wait
}

But it's doesn't works do you know why ?

Thank you

twenty94470
  • 105
  • 2
  • 12

0 Answers0