[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 12 KB, 391x256, IC816884.png [View same] [iqdb] [saucenao] [google] [report]
59559657 No.59559657 [Reply] [Original] [archived.moe] [rbt]

Sup /g/, I need some help with a very basic powershell script.

I need to trim a string to make something more "pretty" for a coworker.

Right now my script is...
$Server = Read-Host -Prompt 'Enter IP'
$Results = Get-WmiObject -Class Win32_Desktop -ComputerName $Server | select-string -pattern "Name"

and the output of this looks like...
\\HOSTNAME\root\cimv2:Win32_Desktop.Name="NT AUTHORITY\\SYSTEM"
\\HOSTNAME\root\cimv2:Win32_Desktop.Name="NT AUTHORITY\\LOCAL SERVICE"
\\HOSTNAME\root\cimv2:Win32_Desktop.Name="NT AUTHORITY\\NETWORK SERVICE"

I'd like the output to only be the part between the quotes, any suggestions?

>> No.59560498

my guess is your'e probably going to need to use the -exclude modifier. Other than that all i can say is install gentoo

>> No.59560565

You should install gentoo

>> No.59561026

The first problem is you're using winshit, install anything else

>> No.59561542
File: 2 KB, 125x83, stallman.jpg [View same] [iqdb] [saucenao] [google] [report]

>using botnet

>> No.59561620

Why not regex search for start > anything > = and then replace the match with nothing?

>> No.59562319



Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.