Home > ITPro, PowerShell > PowerShell for asp.net developer part 1

PowerShell for asp.net developer part 1

Power Shell is the new scripting language promoted by Microsoft. It has tremendous potential and as asp.net developer you can utilize it to complete some daily tasks.

To run PowerShell , you can key windows Key +R , type PowerShell

The PowerShell command will show up


You can add the IIS Snap-in using command Import-Module WebAdministration. However , it might throw exception below.

 

You need to restart your PowerShell under administrator and run the command SET-EXECUTIONPOLICY remoteSigned and then Import-Module WebAdministration.

(You can check TechNet page for details) You can test the setup by running Get-Website, this command will retrieve all the web sites from IIS.

To create web site under IIS , you can use the command New-Website. You can type Get-Help New-Website to see all the parameters.


 
 

Now we create web site called mystie by running command

First , you need to create a folder

New-Item $env:systemdrive\inetpub\MyNewWebSite -type directory

Then create the site this folder directory as the website physical path

New-Website -name “MyNewWebSite” -PhysicalPath “$env:systemdrive\inetpub\MyNewWebSite” -port 8888


  
 

kick it on DotNetKicks.com

Shout it

About these ads
Categories: ITPro, PowerShell
  1. April 25, 2010 at 8:02 am

    thanks

  1. April 22, 2010 at 1:08 pm
  2. April 22, 2010 at 1:28 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 169 other followers

%d bloggers like this: