Wednesday, October 20, 2010

Windows PowerShell Config

WINDOWS POWER SHELL

PS C:\scripts> cd c:\windows
PS C:\WINDOWS> 
Or, if you prefer:
PS C:\scripts> chdir c:\windows
PS C:\WINDOWS>
Set location:
PS C:\scripts> Set-Location C:\Windows
PS C:\WINDOWS>
PS C:\WINDOWS> Get-Process
//to get recursive list of all items inside the folders. (-r)
> Get-ChildItem C:\Scripts -recurse
get-alias
get-command ...
$a = Get-ChildItem C:\Scripts
$a
Save as .ps1

Note : If you had any problem while running any PowerShell script, this could be one of the problem...then type below command at command prompt, and hit enter key...
> set-executionpolicy RemoteSigned

How to install:
--------------
1. Download and install the VMware VI Toolkit for Windows.
2. Download the VMware.VIToolkit.powerpack file that is attached to this article.
3. Open the PowerGUI Admin Console.
4. In the PowerGUI Admin Console, right-click the root node and select the Import menu command.
5. Import the VMware.VIToolkit.powerpack file that you downloaded in step 2.
6. Expand the "VMware" folder.
7. Select the "Managed VMware Hosts" node and use the "Add connection..." action to start adding the VMware hosts you want to manage with the VMware PowerPack.
8. Once you have added VMware hosts that you will manage, use any of the subnodes of the Managed VMware Hosts node to manage VMware objects or the host itself.

How to upgrade:
----------------
1. Download the VMware.VIToolkit.powerpack file that is attached to this article.
2. If you added or modified items in the PowerPack since installing it, close PowerGUI and then navigate to the Quest Software\PowerGUI subfolder of your roaming profile folder. You can find this folder by executing this string in PowerShell: "$([System.Environment]::GetFolderPath('ApplicationData'))\Quest Software\PowerGUI". In this folder, make a backup copy of your Quest.PowerGUI.xml file to ensure your customizations are backed up.
3. Open the PowerGUI Admin Console.
4. In the PowerGUI Admin Console, right-click the VMware folder and select the Delete menu command.
4. Once you have deleted the old version of the VMware PowerPack, right-click the root node and select the Import menu command.
5. Import the updated VMware.VIToolkit.powerpack file that you downloaded in step 1.
6. Once you have imported the updated VMware.VIToolkit.powerpack file, your VMware PowerPack will be up to date.
How to enable vDiagram support:
1. Download the VESI_Visio.zip file that is attached to this article.
2. If you agree to abide by the enclosed Legal Agreement document, extract the VESI_Visio.vss file into your 'My Shapes' folder. This can be found by entering the following string in PowerShell: "$([System.Environment]::GetFolderPath('MyDocuments'))\My Shapes".

No comments:

Post a Comment

 

©2010 Software Testing powered by Free Blogger Templates | Author : Anand Satish