PoshCode Archive  Artifact [2ac8d60287]

Artifact 2ac8d6028730e02b672319bb3852766fd71531d934b6acb9a3f1bda5a5a3ed8b:

  • File Get-NetView.ps1 — part of check-in [6d1a9f188c] at 2018-06-10 13:41:55 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: 625)

# 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: 4500
# x-derived-from-id: 4501
# x-archived: 2015-03-28T09:09:14
# x-published: 2015-09-30T20:42:00
#
#
function Get-NetView {
	switch -regex (NET.EXE VIEW) { "^\\\\(?<Name>\S+)\s+" {$matches.Name}}
	}