Hi all,
I’m trying to get to grips with formatting. I decide to mess around with another script I had been using that works great. I’ve copied part of it and made some changes to simplify it for learning. I’ve run into a problem and was hoping to pick your brains.
Here’s what I’m working with.
$fmtbios =@{label=“BIOS” ;alignment=“left” ;width=5 ;Epression={$.SMBIOSBIOSVersion};}
$fmtcompany =@{label=“Company” ;alignment=“left” ;width=10 ;Epression={$.Manufacturer};}
$fmtbiosdate =@{label=“BIOS Date” ;alignment=“left” ;width=38 ;Epression={$.Name};}
$fmtserial =@{label=“Serial #” ;alignment=“left” ;width=7 ;Epression={$.SerialNumber};}
$fmtversion =@{label=“Version” ;alignment=“left” ;width=17 ;Epression={$_.Version};}
$bios = Get-WmiObject win32_bios
Write-Output $bios | Format-Table $fmtbios, $fmtcompany, $fmtbiosdate, $fmtserial, $fmtversion | out-file c:\fortmattest.txt
I get and error message stating
Format-Table : Illegal key Epression
At line:9 char:22
- Write-Output $bios | Format-Table $fmtbios, $fmtcompany, $fmtbiosdate, $fmtseria …
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: ( [Format-Table], NotSupportedException
- FullyQualifiedErrorId : DictionaryKeyIllegal,Microsoft.PowerShell.Commands.FormatTableCommand
I’ve no doubt that I’m being stupid but as you guys are always so helpful I thought I would see what info you can provide.
Thanks!