troubleshooting Question

script filtering multiple returns to menu

Avatar of Deacon Eugene Wohlfarth
Deacon Eugene Wohlfarth asked on
Powershell
7 Comments1 Solution74 ViewsLast Modified:
here's is what I am trying to do:

install printer on a remote machine . Sounds simple eh?

the script will gather information from a master printer list (csv) it will then take make,model an ip address from the csv and execute vb script to set up printer.

now here is where it gets complicated. on occasion a location will have more than one printer. how can i offer the user a choice of which printer to install in this case?

I have attached some of the code I am using to test...

the PSCustomObject section prints the information very nicely, I now need to turn that into a menu/selection option...
$list = Import-Excel -path "C:\Users\ewholfarth\Downloads\posh1.xlsx"  
$list | export-Csv "C:\Users\ewholfarth\Downloads\posh1.csv"


$printerlist =import-csv -path "C:\Users\ewholfarth\Downloads\posh1.csv"
$printercount = $printerlist.count;
$jobnumber = read-host "Enter job number =>"
$currentitem = 1;
$i = 1

foreach($printer in $printerlist){
    if ($printer.job_number -eq $jobnumber){
        [PSCustomObject][ordered]@{
            Make   = $printer.make
            Model  = $printer.model
            'Job#' = $printer.job_number
        }
    }
}



Thanks,

Eugene
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros