PowerShell Can Browse a Network Share

by percent20 4/10/2008 1:51:00 PM

If you follow me on twitter then you probably know that I like Anime. If you don't follow me, you should, then to let you know. I like Anime.  Recently, a friend in #alt.net channel on freenode.  Was helping me with a script to do some specific renaming to strip out extra crap from anime I download.

Anyway, I have a network share on my anime folder so I can access it from anywhere on my network and watch.  Well last night without thinking I just opened up PowerShell CD'd to the network share and ran the script, since I have full control set on the share.  After the shows were renamed I closed it and went about finishing Bamboo Blade.

Later I realized I browsed a network share in PowerShell.  That is SOOOOO freaking cool that you can do that.  Here is an image proving it:

powershellNetworkShare

Basically, I am starting in my "My Documents" folder on my computer and CD'ing to the remote computer and it works.  Then I do a pwd for the path, and viola it works.

This is cool to me and might allow some cool scripts to be run for copying local files to remote servers with a simple click.

When I get the script a little more refined I'll go ahead and post it up with a blog post.

Here is a silverlight video of it in action. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Awesome Stuff | powershell

PowerShell Hello World Script

by percent20 1/15/2008 6:01:00 AM

I have been wanting to learn PowerShell for a while now and one of the guys in the #alt.net irc channel talks about it all the time. So I decided to give it another shot.  The first thing I wanted to do was write a Hello World script that just out put that text to the screen running form a script file.  It wasn't so easy to figure it out believe it or not and there wasn't a good Hello World tutorial on the net I could find.  Finally, after a while of just trying stuff and following half instructions I figured out how to get a script to run.

First though you need to Download PowerShell. Please follow that how-to on downloading PowerShell.

After powershell is installed open up the powershell command window and notepad.  I'm not going to go into the why of powershell here because honestly I don't know yet.  Instead i'll give you quick instructions for writing a script that will run.

  • In notepad type out the following ( Write-Output "Hello World" ) without the parenthasis
  • Save file as HelloWorld.ps1
  • Switch to PowerShell command window
  • Navigate to the folder you saved the file in ( I just used C:\ to keep it easy at first )
  • Execute the following command: Set-ExecutionPolicy RemoteSigned (reduces security until you increase it.  There is a very annoying security policy in place for just dev work)
  • Next is to run the script just d: ./HelloWorld.ps1
It should have spit out Hello World do the console.  Congrats you just did a hello world script in powershell 

HelloWorld.ps1 (26.00 bytes)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

powershell

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen


My Flare

AddThis Feed Button

National Blog Posting Month

Eagle Scout

I'm Test Driven

[Reserved for MVP status I want to earn]

View Buddy Lindsey's profile on LinkedIn

Twitter



Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in