Quantcast
Channel: File Services and Storage Forum
Viewing all articles
Browse latest Browse all 1766

Array from Net View (cmd line)

$
0
0

Hi,

I have a requirement to list shares on a non windows box so can't use WMI.  I've found that net view can be used but I am having problems parsing the output?  Here is what I have

$pc = 'goflex_home'

$shares = (NET.EXE VIEW $pc)

$shares
foreach ($line in $shares){

write-host $line
}

 The problems I have is the complete output for net view is 1 element in the array.  Is there a way to parse each line from net view as an array element?

Thanks

The


Alter De Ruine


Viewing all articles
Browse latest Browse all 1766

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>