PS C:Powershell> $IPcfg=ipconfig PS C:Powershell> $IPcfg Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : *** Link-local IPv6 Address . . . . . : *** IPv4 Address. . . . . . . . . . . : 192.168.140.128 Subnet Mask . . . . . . . . . . . : 255.255.252.0 Default Gateway . . . . . . . . . : 192.168.140.1 Tunnel adapter isatap.mossfly.com: Connection-specific DNS Suffix . : *** Link-local IPv6 Address . . . . . : *** Default Gateway . . . . . . . . . :*** Tunnel adapter Teredo Tunneling Pseudo-Interface: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : PS C:Powershell> $IPcfg.Count 22
PS C:Powershell> $ip=ipconfig PS C:Powershell> $ip -is [array] True PS C:Powershell> "abac" -is [array] False PS C:Powershell> $str="字符串" PS C:Powershell> $str.ToCharArray() -is [array] True
PS C:Powershell> ipconfig | Select-String "IP" Windows IP Configuration Link-local IPv6 Address . . . . . : *** IPv4 Address. . . . . . . . . . . : *** Link-local IPv6 Address . . . . . : ***
PS C:Powershell> ls Directory: C:Powershell Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2011/11/23 17:25 ABC d---- 2011/11/29 18:21 myscript -a--- 2011/11/24 18:30 67580 a.html -a--- 2011/11/24 20:04 26384 a.txt -a--- 2011/11/24 20:26 12060 alias -a--- 2011/11/24 20:27 12060 alias.ps1 -a--- 2011/11/23 17:25 0 b.txt -a--- 2011/11/23 17:25 0 c.txt -a--- 2011/11/23 17:25 0 d.txt -a--- 2011/11/25 11:20 556 employee.xml -a--- 2011/11/29 19:23 21466 function.ps1 -a--- 2011/11/28 11:12 186 LogoTestConfig.xml -a--- 2011/11/24 17:37 7420 name.html -a--- 2011/11/28 15:30 63 ping.bat -a--- 2011/11/24 17:44 735892 Powershell_Cmdlets.html -a--- 2011/11/30 16:04 2556 psdrive.html -a--- 2011/12/2 18:47 140 test.ps1 -a--- 2011/11/23 17:37 242 test.txt -a--- 2011/11/28 16:42 170 test.vbs PS C:Powershell> $result=ls PS C:Powershell> $result.Count 20
PS C:Powershell> $result[0].gettype().fullname System.IO.DirectoryInfo PS C:Powershell> $result[0] Directory: C:Powershell Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2011/11/23 17:25 ABC对于任何一个对象都可以使用Format-List * 查看它所有的属性和方法。 PS C:Powershell> $result[0] | fl * PSPath : Microsoft.PowerShell.CoreFileSystem::C:PowershellABC PSParentPath : Microsoft.PowerShell.CoreFileSystem::C:Powershell PSChildName : ABC PSDrive : C PSProvider : Microsoft.PowerShell.CoreFileSystem PSIsContainer : True BaseName : ABC Mode : d---- Name : ABC Parent : Powershell Exists : True Root : C: FullName : C:PowershellABC Extension : CreationTime : 2011/11/23 17:25:53 CreationTimeUtc : 2011/11/23 9:25:53 LastAccessTime : 2011/11/23 17:25:53 LastAccessTimeUtc : 2011/11/23 9:25:53 LastWriteTime : 2011/11/23 17:25:53 LastWriteTimeUtc : 2011/11/23 9:25:53 Attributes : Directory
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有