Welcome

首页 / 软件开发 / .NET编程技术 / 【探索PowerShell 】【五】PowerShell基础知识

【探索PowerShell 】【五】PowerShell基础知识2011-04-25 51cto博客 melvillo在PowerShell中,我们可以轻松的与数据、对象进行交互,为了简化我们访问外部数据, PowerShell允许我们像操作驱动器、文件一样对数据、对象等进行操作。

使用这条命令,查看我们已有的Providers:

get-psprovider

实际上,每一个Provider就是一个动态链接库(.dll),在PowerShell中也可以被称之为 “管理单元”,在管理单元中,有详细的代码实现我们的各种操作。PowerShell甚至允许我 们自己编写Provider:http://msdn.microsoft.com/en-us/library/cc136763 (VS.85).aspx

我们对数据等的操作方式有很多,例如:

cmdlet功能cmd commandalias
get-location当前目录pwdgl
set-location改变操作目录cd,chdirsl
new-item新建文件或文件夹ni
rename-item重命名rnrni
copy-item复制copycpi
move-item移动movemi
remove-item删除delri
set-item设置内容si
clear-item删除内容cli
mkdir新建文件夹md
set-content设置内容sc
get-content获取内容typegc