PowerShell

Shell under Microsoft

SUA - Bash

Enable features

You must have Windows7 pro of Windows server 2008/2008R2, and enable the feature "Subsystem for UNIX-based Applications"

After this install the base package from microsoft. and next update and add the complet SUA environment at suacommunity web site

Now you you a complete POSIX Env, inside Windows operating system.

Powershell 1

Better than dos command and than cmd.exe.

powerfull but not enought, it's depracated since powershell is in version 2.

Powershell 1 is like a draft, the version 2 is very much interesting.

Powershell 2

A very interesting shell. Object oriented scripting language (like ruby, perl,..), full acces to COM and WMI object, and much more, syntax is like DOT.net.

You can/must use this shell, it s simpler and better than bat/cmd scripting, hard to learn for the begening but so powerfull. Powershell is like ssh for miscrosoft.

Powershell command

Begening

The technet doc is your best friend for the begenning,

Some Commands

get the version of powershell

Name       : ConsoleHost
Version    : 2.0
InstanceId : XXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
UI         :System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : fr-FR
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

And remotly

enter-pssession -ComputerName Host1
[Host1]: PS C:\Users\administrator\Documents> get-host
Name             : ServerRemoteHost
Version          : 1.0.0.0
InstanceId       : XXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : fr-FR
CurrentUICulture : en-US
PrivateData      :
IsRunspacePushed :
Runspace         :

For enabling the remote command shell execution you must conneect for the 1st time on the server Host 1 and setup the permission of remote exec and powershel scripting if you want to execute some scripts

Set-ExecutionPolicy -Force unrestricted
Enable-PSRemoting -Force
Set-WSManQuickConfig