Eu quero converter a unidade Length em KB .Assim, uso este comando
ls | Format-Table Name,@{e={[int]($_.Length/1KB) }; Label="KB"}
Name KB
---- --
myscript 0
.countline.txt.swp 16
countline.txt 12
LogoTest.xml 0
ping.bat 0
test.ps1 0
test.vbs 0
test1.ps1 0
Funciona normalmente.Mas estou confuso, por que não posso alterar a variável e em outro nome? como xy ? Quero dizer que este comando falhará
ls | Format-Table Name,@{yz={[int]($_.Length/1KB) }; Label="KB"}
Na verdade, quando eu alterar o e em qualquer nome ou omiti-lo, o Powershell fornecerá informações sobre erros.Eu perdi alguma informação?
Tags powershell