Sorry, total nooby question here. I've just started trying to learn powershell, and have a simple script that I use to find Mac addresses.
$Name = Read-Host "Enter Machine Name"
I'd like for this script, once finshed, to prompt the user to continue, and then go back to the start. Could someone point me in the right direction?
First question has to be what are you trying to achieve?
if this meant to be an interactive tool or are you trying to get the MAC address of a number of machines
I'm going to assume the latter in which case you want something like this:
The param block accepts the name of the computer. I moved the filter into the Get-WmiObject -Filter because then the filter happens on the remote machine not your local machine
Better still make the script a function that accepts pipeline input
Load the function like this:
You can then use it like this:
I would strongly urge you to buy and read Powershell in a Month of Lunches (www.manning.com/jones3) which is the best introduction to PowerShell
This is fantastic, thank you.
I'm reading Windows Powershell 3.0 First Steps, at the moment, and will probably read your suggestion too.
You must be logged in to reply to this topic.