cmdlet功能cmdcommandaliasget-location当前目录pwdglset-location改变操作目录cd,chdirslnew-item新建文件或文件夹无nirename-item重命名rnrnicopy-item复制copycpimove-item移动movemiremove-item删除delriset-item设置内容无siclear-item删除内容无climkdir新建文件夹md无se..
分类:
系统相关 时间:
2015-05-13 17:11:42
阅读次数:
147
#mailserverconfiguration$smtpServer="发送地址SMTP"$smtpuser="邮件地址"$smtpPassword="密码"#Createthemailmessage$mail=New-ObjectSystem.Net.Mail.MailMessage#SettheAddresses$mailaddress="邮件地址"$users=@()$users=Import-Csv-Path"c:\user.csv"用户邮箱foreach($us..
分类:
其他好文 时间:
2015-05-13 17:11:19
阅读次数:
279
functionfunline($strin="hello"){$num=$strin.lengthfor($i=1;$i-le$num;$i++){$funline=$funline+"="}Write-Host-ForegroundColorYellow$strinWrite-Host-ForegroundColorDarkRed$funline}$folder="C:\Users\qliangliang.BOOK\Documents"$date=get-date$limit=3$xfiles=$Null..
分类:
系统相关 时间:
2015-05-12 19:08:50
阅读次数:
166
要求DHCP的PowerShell为4.02012R2系统这个脚本可以方便SCO以及编程中调用,可以做成审批流,方便用户提交绑定IP的申请。Get-DhcpServerv4Lease-ComputerNamedc.contoso.com-IPAddress192.168.136.25|selectIPAddress,hostname,addressstate,leaseexpirytime
#以上语句获取192.1..
分类:
系统相关 时间:
2015-05-11 18:14:33
阅读次数:
198
支持所有PS版本。WMI服务能够报告详细的硬件信息。通常,每个硬件都来自它们自己的WMI代理类。但是要找出这些硬件类的名字是不容易。所有硬件类都在同一个WMI根下面,你可以在根类查询所有的硬件:1Get-WmiObject -Class CIM_LogicalDevice |Out-GridView...
分类:
系统相关 时间:
2015-05-11 10:40:49
阅读次数:
168
为了输出一些特殊字符,我们需要使用转义字符,在PowerShell中,转义序列由反引号定义,也就是键盘F1下面与波浪线同键的字符" ` "。 常用的转义字符串有: `'单引号`"双引号`0空值 NULL`a报警`b退格`f跳页`n新行`r换行`t横向Tab键(水平制表符)`v纵向Tab键(纵向制表符...
分类:
其他好文 时间:
2015-05-10 22:19:33
阅读次数:
154
在WMI中使用Win32_NTLogEvent查询出来的日志生成时间timegenerated类似于“20130820162350.350000+480“,这种时间格式很特殊,经查是DMTF时间格式字符串,在PowerShell中与其它时间类型进行比较就需要对其进行转换,将DMTF字符串转DateT...
分类:
其他好文 时间:
2015-05-10 17:08:20
阅读次数:
907
http://www.lazywinadmin.com/2014/03/powershell-read-excel-file-using-com.htmlLast week, I worked on a small PowerShell script to read a custom excel f...
分类:
系统相关 时间:
2015-05-08 20:02:07
阅读次数:
642
ls Variable:NameValueDescription$?TRUEStatus of last command^argsSystem.Object[]ConfirmPreferenceHighDictates when confirmation should be requested. C...
分类:
系统相关 时间:
2015-05-08 19:59:49
阅读次数:
199
Powershell 默认支持的.NET类型如下:[order],[pscustomobject],[array],[bool],[byte],[char],[datetime],[decimal],[double],[guid],[hashtable],[int16],[int32],[int],...
分类:
系统相关 时间:
2015-05-08 19:59:39
阅读次数:
127