Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

No dialog window after a Get-ChildItem

$
0
0

Hello,

 I migrate from VISTA to 8.1

and a script has now a failure
that the dialog of Forms.MessageBox is not shown and evaluated

after a statement like

$jpgs = Get-ChildItem "C:\Windows\Logs" -filter *.jpg
 

It would be nice, that someone has an answer for it.

Erhy

The full script:

# Test_MsgBox start with powershell -Command "C:\Users\Public\Documents\prog\convert_robot\Test_MsgBoxV2.ps1"  && pause

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null

# if following line removed
#              MsgBox works
$jpgs = Get-ChildItem "C:\Windows\Logs" -filter *.jpg"before question"
$yesno  = [System.Windows.Forms.MessageBox]::Show(
         'YEs or NO?', "Test Windows.Forms.MessageBox" ,
         [Windows.Forms.MessageBoxButtons]::YesNo,
        [System.Windows.Forms.MessageBoxIcon]::Question,
        [System.Windows.Forms.MessageBoxDefaultButton]::Button1,
        [System.Windows.Forms.MessageBoxOptions]::DefaultDesktopOnly 
     )




Viewing all articles
Browse latest Browse all 2314

Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>