Powerwshell character @, N and E?

Example code:
<p class=“x-hidden-focus”>Get-WmiObject -Class win32_OperatingSystem -ComputerName webr201 |</p>
<p class=“x-hidden-focus”>select @{N=‘ComputerName’; E={$.PSComputerName}},</p>
<p class=“x-hidden-focus”>@{N=‘OS’; E={$.caption}},
<p class=“x-hidden-focus”>@{N=‘SP’; E={$_.ServicePackMajorVersion}}</p>

What is @ an what are N and E?

Really appreciate your answer.

In other words - I´m new with Powershell

Check out example 4 here for an example of a calculated property.

Also, Adam has a good post here:

`@{}` indicates a creation of a hashtable.

N = Name, E = Expression.

Using aliases in PowerShell is not recommended for the reasons you just asked in your question. New PowerShell users may not know the alias or abbreviation of a command.


PS C:\users\me> $a = @{N='ComputerName'; E={$_.PSComputerName}}
PS C:\users\me> $a

Name                           Value
----                           -----
N                              ComputerName
E                              $_.PSComputerName

PS C:\users\me> $a.n
PS C:\users\me> $a.gettype()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Hashtable                                System.Object

PS C:\users\me> Get-WmiObject win32_OperatingSystem | select $a


PS C:\users\me> $b = {$_.PSComputerName}
PS C:\users\me> $b.gettype()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     ScriptBlock                              System.Object

Great, problem solved