PoshCode Archive  Artifact [81d3713b80]

Artifact 81d3713b80440cf324c7dd0b3b0f2cf43c54ea00c4a6bea24ef66afdeada94c1:

  • File Get-NetView.ps1 — part of check-in [4f965446f5] at 2018-06-10 14:25:51 on branch trunk — A one liner that parses the output of NET.EXE’s VIEW command. NET.EXE VIEW displays a list of computers in your current domain by default, to display another domain change it to read NET.EXE VIEW /domain <domainName>. (user: Nathan Hartley size: 597)

# encoding: ascii
# api: powershell
# title: Get-NetView
# description: A one liner that parses the output of NET.EXE’s VIEW command. NET.EXE VIEW displays a list of computers in your current domain by default, to display another domain change it to read NET.EXE VIEW /domain <domainName>.
# version: 0.1
# type: function
# author: Nathan Hartley
# license: CC0
# function: Get-NetView
# x-poshcode-id: 882
# x-archived: 2017-04-04T05:05:37
# x-published: 2009-02-19T15:46:00
#
#
function Get-NetView {
	switch -regex (NET.EXE VIEW) { "^\\\\(?<Name>\S+)\s+" {$matches.Name}}
	}