PowerShell Archive

PowerShell MessageBox

If you want to display a dialog box / MessageBox from PowerShell rather than spitting out console text try this function: function Show-MsgBox { param ( [Parameter(Mandatory=$true)] [String]$Text, [String]$Title = 'Message', [String] $Icon = 'YesNo,Information' ) Add-Type -AssemblyName 'Microsoft.VisualBasic' [Microsoft.VisualBasic.Interaction]::MsgBox($text, $icon, $title) } Show-MsgBox -Text 'Reboot system?' -Title 'Warning' -Icon 'YesNoCancel,Question' $result = Show-MsgBox -Text [&hellip

Read More…

Remotely Launching Processes

Unfortunately, the Start-Process cmdlet has no -ComputerName parameter so you cannot use it to launch processes remotely on other machines on your network. Use WMI instead! This line will run mspaint.exe on your local machine: PS> (Invoke-WmiMethod Win32_Process Create mspaint.exe).ReturnValue -eq 0 True And this slight adaption will run mspaint.exe on a computer named “PC1″ [&hellip

Read More…

Text to Audio in PowerShell

Did you know that PowerShell can turn text to audio? All you need is some text or text file. You can then turn the text into spoken language, convert it to a WAV file and play it back or send it to someone. Here’s how: $Path = "$env:temp\file.wav" Add-Type -AssemblyName System.Speech $synthesizer = New-Object -TypeName [&hellip

Read More…