Sort by function


how eliminate second get-minvalue?

gci | sort {get-minvalue ($_.creationtime, $_.lastaccesstime, $_.lastwritetime)}, name | ft name, @{label="mindate";expression={get-minvalue ($_.creationtime, $_.lastaccesstime, $_.lastwritetime)}}

i'd have like

gci | sort {mindate=get-minvalue ($_.creationtime, $_.lastaccesstime, $_.lastwritetime)}, name | ft name, mindate

is trying do?

gci |  	select @{n='minvalue';e={ (($_.creationtime, $_.lastaccesstime, $_.lastwritetime)|measure-object -min).minimum }}, name


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

DCOM received error "2147746132" from...

DFSR RPC replication errors 5014 1726 with large files over VPN

ADFS 3.0 Event ID 4625 | An Error occurred During Logon | Status: 0xC000035B