SynJunkie
 New Member Posts:97

 |
| 11 Oct 2008 02:33 PM |
|
occasionally i see the @ character used in scripts but i'm unsure what it is used for. could anyone explain this please.
Thanks
Lee |
|
|
|
|
marco.shaw Co-Community Director
 Basic Member Posts:188

 |
| 11 Oct 2008 03:15 PM |
|
These are all the examples I can think of quickly: PS>$my_array=@() <--an array PS>$my_hashtable=@{} <--a hashtable PS>$my_here_string=@" <--a HERE string >> some_text >> "@ >> PS> So, "@" can be used in various constructs. |
|
Marco
*Microsoft MVP - Windows PowerShell: http://www.microsoft.com/mvp *PowerGadgets MVP: http://www.powergadgets.com/mvp *Blog: http://marcoshaw.blogspot.com |
|
|
SynJunkie
 New Member Posts:97

 |
| 21 Oct 2008 01:37 PM |
|
Thanks Marco. That helps. I'll have play around and get my head around it properly. Cheers Lee |
|
|
|
|
edm365f31
 New Member Posts:38

 |
| 21 Oct 2008 02:41 PM |
|
Marco - I did not get this? So what is @ is it an alias for a cmdlet, what is it called and what does it do? Thanks Ed |
|
|
|
|
halr9000 PowerShell MVP, Site Admin
 Basic Member Posts:334

 |
| 21 Oct 2008 02:44 PM |
|
In version 1, it is _part_ of two operators, the array operator and the hashtable operator. array: @() hashtable: @{} In version 2, there will be an additional meaning which I won't go into here because it won't clarify anything. :) |
|
Community Director, PowerShellCommunity.org Co-host, PowerScripting Podcast Author, TechProsaic |
|
|
halr9000 PowerShell MVP, Site Admin
 Basic Member Posts:334

 |
|
glnsize
 Basic Member Posts:101
 |
| 21 Oct 2008 11:16 PM |
|
Posted By halr9000 on 10/21/2008 6:44 AM
In version 2, there will be an additional meaning which I won't go into here because it won't clarify anything. :)
tease...
|
|
|
|
|
halr9000 PowerShell MVP, Site Admin
 Basic Member Posts:334

 |
|
glnsize
 Basic Member Posts:101
 |
| 26 Oct 2008 01:01 AM |
|
That is cool, but isn't that still a hashtable? It seams to me the only real difference is that powershell will unwrap the name value pairs and pass them to the cmdlet. The construct doesn't appear to be taking a new form.
Thanks
~Glenn |
|
|
|
|
halr9000 PowerShell MVP, Site Admin
 Basic Member Posts:334

 |
|