PowerShell 教程

PowerShell 教程

基础资源

视频列表 文档列表 演示代码 Github 地址 PowerShell Gallery - 用户创作中心

基础操作

基础概念

lesson1 基础命令

三个基础命令

这几个命令真的是基础中的基础,非常棒!!!

lesson2 Pipeline

Pipeline |

lesson3 History

PowerShell History and Current State(历史课)

lesson4 准备开发

Getting setup for PowerShell Development PowerShell 开发准备

lesson5 变量

PowerShell Variables PowerShell 变量

lesson6 流程控制

Taking Control with PowerShell Logic(PowerShell 逻辑?难道是流程控制?是的,就是流程控制)

其中多个逻辑条件,与或非:像比较符,-gt 表示 >-ge 表示 >=-lt 表示 <-le 表示 <=,关系运算符:-not 表示 !-and 表示 &&,-or 表示 ||n 开头表示 not

lesson7 I/O

PowerShell Input & Output 也就是 I/O

之前介绍变量的时候实际上也是一种输入,一种静态的输入,现在我们可以尝试多种输入方式,ConvertFrom 和 ConvertTo 类的 cmdlet 非常好用,要常用

lesson8 异常处理

PowerShell Errors and Exceptions Handling,错误和异常处理

PowerShell 有两个 Pipeline,success pipeline, or the success stream 和 error pipeline, or the error stream

lesson9(批量)远程

PowerShell Remoting 远程,利用 PowerShell 管理远程服务器,这是 PowerShell 的非常强力的工具之一,能极大的提升工作效率,这一章会讲很多 PowerShell 以外的基础的系统知识:

可能的连接场景:

每一种场景都需要不同的配置(区别不大),课程的演示环境为 Hyper-V 虚拟机

这一章有点儿难,不要被劝退

本章节演示代码地址

lesson10 脚本编写

PowerShell Scripts

这一课的例子和场景很常用,同时很有启发性,

lesson 11 方法

PowerShell Functions 方法

lesson12 云服务器管理

Manage Cloud,PowerShell 可以管理主流云服务器,比如 Azure, AWS, or Google Cloud.

这一章暂时还用不到,以后再学习吧。

附录

测试脚本