PS C:Powershell> $stu=@{ Name = "小明";Age="12";sex="男" }
PS C:Powershell> $stu
Name Value
---- -----
Name 小明
Age 12
sex 男
PS C:Powershell> $stu["Name"]
小明
PS C:Powershell> $stu["age"]
12
PS C:Powershell> $stu.Count
3
PS C:Powershell> $stu.Keys
Name
Age
sex
PS C:Powershell> $stu.Values
小明
12
男
PS C:Powershell> $stu=@{ Name = "小明";Age="12";sex="男";Books="三国演义","围城","哈姆雷特" }
PS C:Powershell> $stu
Name Value
---- -----
Books {三国演义, 围城, 哈姆雷特}
Name 小明
Age 12
sex 男
PS C:Powershell> $Student=@{}
PS C:Powershell> $Student.Name="令狐冲"
PS C:Powershell> $Student.School="华山派"
PS C:Powershell> $Student
Name Value
---- -----
Name 令狐冲
School 华山派
PS C:Powershell> $stu
Name Value
---- -----
Books {三国演义, 围城, 哈姆雷特}
Name 小明
Age 12
sex 男
PS C:Powershell> $stu.Name="赵强"
PS C:Powershell> $stu.Name
赵强
PS C:Powershell> $stu.Remove("Name")
PS C:Powershell> $stu
Name Value
---- -----
Books {三国演义, 围城, 哈姆雷特}
Age 12
sex 男
PS C:Powershell> Dir | Format-Table Directory: C:Powershell Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2011/11/23 17:25 ABC d---- 2011/11/29 18:21 myscript PS C:Powershell> Dir | Format-Table FullName,Mode FullName Mode -------- ---- C:PowershellABC d---- C:Powershellmyscript d---- C:Powershella.html -a---
PS C:Powershell> $column1 = @{expression="Name"; width=30;label="filename"; alignment="left"}
PS C:Powershell> $column2 = @{expression="LastWriteTime"; width=40;label="last modification"; alignment="right"}
PS C:Powershell> ls | Format-Table $column1, $column2
filename last modification
-------- -----------------
ABC 2011/11/23 17:25:53
myscript 2011/11/29 18:21:28
a.html 2011/11/24 18:30:13
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有