|
|
Browse by Tags
All Tags » Admin Developme... » REPL
-
The Chat did go on while I made Last blog entry PowerShell : the power of REPL, -WhatIf and ScriptBlocks as Parameter when moving files :
[22:29] <generalhan> ok now time to work on something a bit harder ! ...[22:29] <generalhan> i have to move files based on date now too !
[22:31] <generalhan> so i have a ...
-
from the Hey Scripting Guy article :
How Can I Parse a Tab-Delimited File and Then Save That as a Comma-Separated Values File?
gc tab.txt |% {$_.split(''`t'') |? {$_ -match '='} |% {$r = new-object object} {$r | add-Member -memberType noteProperty -name $_.split('=')[0] -Value $_.split('=')[1]}{$r}} | export-csv -NoTypeInformation ...
-
And another Hey, Scripting Guy ! translation to powerShell How Can I Get the Uptime of a Service?
The PowerShell translation :
$s = gwmi win32_service -filter ''name = 'spooler'''
''{0}'' -f ((get-date) - ([wmi]'').ConvertToDateTime((gwmi Win32_Process -filter ''ProcessID = '$($s.ProcessId)''').CreationDate))
I do output the Uptime in ...
|
|
|