Archive | PowerShell RSS feed for this section

PowerShell: Showing MsgBox

Ever wanted to display a dialog box from PowerShell rather than spitting out console text? Then 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) } It is really easy to use: simply tell it what to display: Show-MsgBox -Text […]

Continue Reading →

PowerShell: Executing PowerShell on Computer Lock

PowerShell can respond to system events such as locking or unlocking a session. Here is a fun sample. Provided you have your sound card turned on, your computer will say good-bye when you press WIN+L and welcome you back when you log on again: function Start-Fun { $null = Register-ObjectEvent -InputObject ([Microsoft.Win32.SystemEvents]) -EventName “SessionSwitch” -Action […]

Continue Reading →

PowerShell: Script Signing

Signing a script doesn’t mean you’re approving or authorizing it, as you might do with a contract or a credit card slip. In the world of digital security, signing is the process of affixing your identity to something and ensuring that the state or condition of that “something” has not been modified in any way. […]

Continue Reading →

PowerShell: Execution Policy

The Restricted execution policy is a default setting for all computers with PowerShell installed. It isn’t intended to be something that PowerShell users live with forever. It’s a safe default that protects non PowerShell users from being impacted by PowerShell-based malware. For example, many home users had never used VBScript, but still got bitten by the […]

Continue Reading →

PowerShell: Remoting

The Windows PowerShell remoting features are supported by the WS-Management protocol and the Windows Remote Management (WinRM) service that implements WS-Management in Windows. Computers running Windows 7 and later include WinRM 2.0 or later. On computers running earlier versions of Windows, you need to install WinRM 2.0 or later as appropriate and if supported. Currently, […]

Continue Reading →

PowerShell: Introduction

PowerShell is a new command shell from Microsoft, based on the Win32 console. It is a command prompt and scripting environment and it can even be both at the same time. To be more precise, Windows PowerShell is Microsoft’s task automation framework, consisting of a command-line shell and associated scripting language built on top of, […]

Continue Reading →
revia in alcoholism