2016-03-04 23:48:30 +01:00
|
|
|
Describe "Format-Table" {
|
2015-08-04 09:31:30 +02:00
|
|
|
It "Should call format table on piped input without error" {
|
2016-03-04 23:52:27 +01:00
|
|
|
{ Get-Process | Format-Table } | Should Not Throw
|
2015-08-04 09:31:30 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
{ Get-Process | ft } | Should Not Throw
|
2015-08-04 09:31:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should return a format object data type" {
|
2016-03-04 23:52:27 +01:00
|
|
|
$val = (Get-Process | Format-Table | gm )
|
2015-08-04 09:31:30 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
$val2 = (Get-Process | Format-Table | gm )
|
2015-08-04 09:31:30 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
$val.TypeName | Should Match "Microsoft.Powershell.Commands.Internal.Format"
|
2015-08-04 09:31:30 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
$val2.TypeName | Should Match "Microsoft.Powershell.Commands.Internal.Format"
|
2015-08-04 09:31:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should be able to be called with optional parameters" {
|
2016-03-04 23:52:27 +01:00
|
|
|
$v1 = (Get-Process | Format-Table *)
|
|
|
|
$v2 = (Get-Process | Format-Table -Property ProcessName)
|
|
|
|
$v3 = (Get-Process | Format-Table -GroupBy ProcessName)
|
|
|
|
$v4 = (Get-Process | Format-Table -View StartTime)
|
|
|
|
|
|
|
|
$v12 = (Get-Process | ft *)
|
|
|
|
$v22 = (Get-Process | ft -Property ProcessName)
|
|
|
|
$v32 = (Get-Process | ft -GroupBy ProcessName)
|
|
|
|
$v42 = (Get-Process | ft -View StartTime)
|
|
|
|
|
|
|
|
{ $v1 } | Should Not Throw
|
|
|
|
{ $v2 } | Should Not Throw
|
|
|
|
{ $v3 } | Should Not Throw
|
|
|
|
{ $v4 } | Should Not Throw
|
|
|
|
|
|
|
|
{ $v12 } | Should Not Throw
|
|
|
|
{ $v22 } | Should Not Throw
|
|
|
|
{ $v32 } | Should Not Throw
|
|
|
|
{ $v42 } | Should Not Throw
|
2015-08-04 09:31:30 +02:00
|
|
|
}
|
2016-03-04 23:48:30 +01:00
|
|
|
}
|