Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Formatting CSV output

$
0
0

I've knocked together the following script, so it reads a csv file, then a user can select Location of a device, then the type of device, at this point the function created reads the spreadsheet and the results are returned in the multiline box.

I'm now stuck, as I want the output to appear in a formatted list with the ability to click on the URL to launch it in IE.

I've not attached the form, but just the function:

function Retrieve_Device {

$loc = $objComboBox0.Text

$Type = $objComboBox1.Text

$a = Import-CSV -path d:\scripts\devices.csv

$url = $a | Where-Object {$_.Location -eq "$loc" -and $_.Type -eq "$Type"} | Select-Object -Property Device, URL | Out-String

$objOutPutBox.Text = $url

}

 

CSV is as follows:

Location,Type,Device,URL

 

Any ideas ?

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles