mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
  1. Main page
  2. M365
  3. Main content

语法 – “@”符号在Powershell中做什么?

2019-05-17 110hotness 0likes 0comments

我看到了在PowerShell中使用的@符号来初始化数组。 @符号是什么意思,我在哪里可以阅读更多?

最佳答案

PowerShell实际上会将任何逗号分隔的列表视为数组:

“server1”,“server2”

所以在这些情况下@是可选的。但是,对于关联数组,@是必需的:

@ {“Key”=“Value”;“Key2”=“Value2”}

官方来说,@是“数组运算符”。您可以在与PowerShell一起安装的文档中或者在我共同创作的“Windows PowerShell:TFM”这样的书中阅读更多信息。

Tag: Nothing
Last updated:2019-05-17

mikebai

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang