濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Windows Powershell 創(chuàng)建數(shù)組

Windows Powershell 創(chuàng)建數(shù)組

熱門(mén)標(biāo)簽:如何根據(jù)經(jīng)緯度百度地圖標(biāo)注 地圖標(biāo)注的圖案 莫拉克電梯系統(tǒng)外呼怎么設(shè)置 六寸地圖標(biāo)注點(diǎn)怎么刪除 騰訊地圖標(biāo)注中心怎么標(biāo)注 萬(wàn)全縣地圖標(biāo)注app 新鄭電銷機(jī)器人一個(gè)月多少錢(qián) 電話機(jī)器人公司招聘 印臺(tái)區(qū)呼叫中心外呼系統(tǒng)

在Powershell中創(chuàng)建數(shù)組可以使用逗號(hào)。

PS C:Powershell> $nums=2,0,1,2
PS C:Powershell> $nums
2
0
1
2

對(duì)于連續(xù)的數(shù)字?jǐn)?shù)組可以使用一個(gè)更快捷的方法

PS C:Powershell> $nums=1..5
PS C:Powershell> $nums
1
2
3
4
5

數(shù)組的多態(tài)
象變量一樣如果數(shù)組中元素的類型為弱類型,默認(rèn)可以存儲(chǔ)不同類型的值。

PS C:Powershell> $array=1,"2012世界末日",([System.Guid]::NewGuid()),(get-date)
PS C:Powershell> $array
1
2012世界末日

Guid
----
06a88783-a181-4511-9e41-2780ecbd7924

DisplayHint : DateTime
Date    : 2011/12/9 0:00:00
Day     : 9
DayOfWeek  : Friday
DayOfYear  : 343
Hour    : 14
Kind    : Local
Millisecond : 910
Minute   : 15
Month    : 12
Second   : 45
Ticks    : 634590369459101334
TimeOfDay  : 14:15:45.9101334
Year    : 2011
DateTime  : 2011年12月9日 14:15:45

空數(shù)組和單元素?cái)?shù)組
空數(shù)組

PS C:Powershell> $a=@()
PS C:Powershell> $a -is [array]
True
PS C:Powershell> $a.Count
0

1個(gè)元素的數(shù)組

PS C:Powershell> $a=,"moss"
PS C:Powershell> $a -is [array]
True
PS C:Powershell> $a.Count
1

您可能感興趣的文章:
  • Windows Powershell 訪問(wèn)數(shù)組
  • Windows Powershell 復(fù)制數(shù)組
  • Windows Powershell強(qiáng)類型數(shù)組
  • Windows Powershell使用哈希表
  • Windows Powershell使用管道
  • Windows Powershell對(duì)象轉(zhuǎn)換成文本

標(biāo)簽:汕頭 天水 疫苗接種 臨汾 襄陽(yáng) 喀什 南昌 湘潭

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Windows Powershell 創(chuàng)建數(shù)組》,本文關(guān)鍵詞  Windows,Powershell,創(chuàng)建,數(shù)組,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Windows Powershell 創(chuàng)建數(shù)組》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Windows Powershell 創(chuàng)建數(shù)組的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    曲靖市| 溧水县| 马公市| 海宁市| 襄垣县| 和政县| 英超| 简阳市| 嘉荫县| 横山县| 灌云县| 景泰县| 沅江市| 土默特左旗| 乌兰察布市| 蓝田县| 杂多县| 磴口县| 高淳县| 于都县| 西华县| 两当县| 台江县| 景泰县| 齐河县| 六安市| 嘉荫县| 友谊县| 兴文县| 长汀县| 丰原市| 永昌县| 清新县| 淮南市| 福贡县| 广水市| 阿合奇县| 南丹县| 新干县| 石门县| 衡山县|