Powershell: How to pass arguments

Dear Readers, I am learning powershell so I was testing something......

I created a simple script  called hello.ps1 by typing in (PS) "notepad hello.ps1"

It contains a command called gci (get-childitem). After entering the command in noted pad I saved it.

I have heard that we can pass arguments to the script name in PS.

Therefore, my Question is how can I filter the gci command I created. The command below that I wrote is not working:

I want to enter in PS a statement that spits out only .docx or .txt files or this is not possible? Can someone fill in the gaps in my knowledge.

1. .\hello *.docx (doesn't work)

2. .\hello.ps1 *.docx (doesn't work)

Thanks so much!

SQL 75

 


  • Edited by SQL75 Friday, February 20, 2015 2:30 AM
February 20th, 2015 5:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics