欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Windows 8 中的 PowerShell 3.0

程序员文章站 2022-03-04 15:32:27
windows 8 惊艳登场,当metro界面吸引了无数人的眼球时,其实还有很多特性值得关注,如powershell 3.0、hyper-v 3.0、vhdx、iis 8等...

windows 8 惊艳登场,当metro界面吸引了无数人的眼球时,其实还有很多特性值得关注,如powershell 3.0、hyper-v 3.0、vhdx、iis 8等。

powershell 2.0实践系列从本次开始全面转向3.0,体验一下powershell 3.0带来的管理方案提升。

很庆幸powergui script editor 可以在windows 8下安装:

Windows 8 中的 PowerShell 3.0

本系列全部脚本在windows 8 x64(powershell 3.0) + powergui script editor 3.0 free edition x64 上测试通过

一、powershell 3.0概述

如同powershell 2.0内置于windows 7和 windows server 2008 r2,在build大会上发布的windows 8 developer preview 和 windows server 8 developer preview也内置了powershell 3.0。我安装的windows 8 developer preview x64,快捷键win + r 打开运行,输入powershell即可打开powershell 3.0的命令行:

Windows 8 中的 PowerShell 3.0

虽然标题栏还是1.0,但是通过全局变量 $host 可以查看具体版本信息:

Windows 8 中的 PowerShell 3.0

未安装 windows 8 的朋友也不必扫兴,微软已经放出了powershell 3.0 ctp1的下载,在下载:

需要注意的是操作系统必须为windows 7 sp1 或 windows server 2008 r2 sp1,且需要.net framework 4.0。

Windows 8 中的 PowerShell 3.0

powershell 3.0 只是 wmf(windows management framework 3.0,windows 管理框架)的一部分,wmf 3.0的新特性有:

1、powershell 3.0

支持 workflows - 让你可以在命令行就可以操作 windows workflow foundation

更稳定的 session - 让你的 session 可以更加适应不稳定的网络、突然停机的系统、随时重新连接

计划任务 - 让你从命令行就可以创建、管理 windows 计划任务

权限托管 - 让受限的用户可以在特定情况下执行更高权限的脚本

更简化的语法 - 让脚本看起来更像程序或者更像自然语言

cmdlet 发掘 - 改进的自动模块加载可以让你更容易发掘系统中的各种 cmdlet

powershell ise插件- 更容易编写脚本命令

2、wmi(windows management instrumentation,windows管理规范)

新的开发模型提供者 - 新的开发模型降低了管理成本,移除了对com的依赖

新的管理客户端api – 提供标准的公共信息模型(cim = common information model)操作,允许在windows上管理*ninx等非windows操作系统

附注:

公共信息模型cim,是一个与具体实现无关的、用于描述管理信息的概念性模型。cim分为两部分:cim 规范(cim specification)和cim 模式(cim schema)。cim 规范提供了模型的正式定义,它描述了语言、命名、元模式和到其他管理模型(如snmp mib)的映射技术;cim 模式则给出了实际模型的描述。cim 模型由核心模型、公共模型和扩展模型三层构成。核心模型是一系列类、连接和属性的集合,该对象组提供了所有管理域通用的基本信息模型;公共模型提供特定管理域的通用信息模型,这些特定的管理域,如系统、应用程序、网络和设备等;扩展模型代表通用模型的特定技术扩展。

通过cim 建模,能够得到管理域中实体的抽象和表示,包括它们的属性、操作和关系。这样的模型独立于任何具体的数据库、应用、协议以及平台。因此,cim 模型要求不同开发商所提供的基于不同平台的应用都采用一种标准的格式来描述管理数据,以使数据能够在多种应用间共享。cim 采用面向对象的方式构建了一种新的适用于管理系统、网络的结构和概念模型。cim 建模是一种通用方法。特定管理域的cim 建模是在核心模型和公共模型的基础上进行扩展。

总的来说公共信息模型(cim)是一个标准,定义了一个前后一致的模型,依据这个模型,网络设备、系统和应用程序能显示有关它们自己的信息,并使这些信息能被管理工具利用cim能描述诸如桌面软件和硬件配置、cpu 封装块的序列号以及某个特殊路由器端口上的流量水平等信息。

也许cim有别于以前标准的最重要之处是其表示组成计算机系统或公司网络的不同单元和部件之间关系的能力。dif主席、novell的公司设计师winston bumpus 称,利用cim"你能看到这台计算机是否与这个应用 程序连在一起,它是在运行从这台服务器上送出的服务。"他还说,通过跟踪路径和检查一路上每个部件的状态,管理工具就能" 回答我为什么不能送出电子邮件这样的问题了。"

cimom 公共信息模型对象管理器(common information model object manager)

是一个描述操作系统构成单元的对象数据库,为mmc和脚本程序提供了一个访问操作系统构成单元的公共接口。

3、winrm(windows remote management,windows 远程管理)

更稳定的连接 - 更加适应不稳定的网络、突然停机的系统、随时重新连接

更弹性的连接 - 当连接中断后,可以迅速重新连接

4、powershell web服务

支持rest形式的web服务使用开放式数据协议(open data protocol ,odata)远程执行powershell脚本,支持windows和非windows客户端。

二、windows server 8中的powershell 3.0新模块

addeploymentwf

applocker

appx

bestpractices

bitstransfer

branchcache

cimcmdlets

clusterawareupdating

directaccessclientcomponents

dism

dnsclient

dnsconfig

dnslookup

dnsnrpt

failoverclusters

fileserver

iscsi

kdscmdlets

microsoft.powershell.core

microsoft.powershell.diagnostics

microsoft.powershell.host

microsoft.powershell.management

microsoft.powershell.security

microsoft.powershell.utility

microsoft.wsman.management

microsoftiscsitarget

msdtc

netadapter

netlbfo

netqos

netswitchteam

nettcpip

netwnv

networkconnectivitystatus

networksecurity

networktransition

pkiclient

printmanagement

ps_mmagent

psdiagnostics

psscheduledjob

psworkflow

rdmanagement

scheduledtasks

secureboot

servermanager

servermanagershell

smbshare

smbwitness

storage

telemetrymanagement

troubleshootingpack

trustedplatformmodule

useraccesslogging

wdac

whea

三、windows 8 developer preview中的powershell 3.0的命令与别名

ac

asnp

clc

cli

clp

clv

compare

cpi

cpp

cvpa

dbp

diff

ebp

epal

epcsv

fc

fl

foreach

%

ft

fw

gal

gbp

gc

gci

gcm

gdr

gcs

ghy

gi

gl

gm

gmo

gp

gps

group

gsv

gsnp

gu

gv

gwmi

iex

ihy

ii

ipmo

iwmi

ipal

ipcsv

measure

mi

mp

nal

ndr

ni

nv

nmo

oh

ogv

ise

rbp

rdr

ri

rni

rnp

rp

rmo

rsnp

rv

rwmi

rvpa

sal

sasv

sbp

sc

select

si

sl

swmi

sleep

sort

sp

saps

start

spps

spsv

sv

tee

where

?

write

rcsn

cnsn

dnsn

irm

iwr

cat

cd

clear

cp

h

history

kill

lp

ls

man

mount

md

mv

popd

ps

pushd

pwd

r

rm

rmdir

echo

cls

chdir

copy

del

dir

erase

move

rd

ren

set

type

icm

clhy

gjb

rcjb

rjb

sajb

spjb

wjb

sujb

rujb

nsn

gsn

rsn

ipsn

epsn

etsn

exsn

sls

add-history

add-pssnapin

clear-history

connect-pssession

disable-psremoting

disable-pssessionconfiguration

disconnect-pssession

enable-psremoting

enable-pssessionconfiguration

enter-pssession

exit-pssession

export-console

export-modulemember

foreach-object

get-command

get-help

get-history

get-job

get-module

get-pssession

get-pssessionconfiguration

get-pssnapin

import-module

invoke-command

invoke-history

new-module

new-modulemanifest

new-pssession

new-pssessionconfigurationfile

new-pssessionoption

new-pstransportoption

out-default

out-host

out-null

receive-job

receive-pssession

register-jobevent

register-pssessionconfiguration

remove-job

remove-module

remove-pssession

remove-pssnapin

resume-job

save-help

set-psdebug

set-pssessionconfiguration

set-strictmode

start-job

stop-job

suspend-job

test-modulemanifest

test-pssessionconfigurationfile

unregister-pssessionconfiguration

update-help

wait-job

where-object

add-computer

add-content

checkpoint-computer

clear-content

clear-eventlog

clear-item

clear-itemproperty

complete-transaction

convert-path

copy-item

copy-itemproperty

debug-process

disable-computerrestore

enable-computerrestore

export-cimcommand

get-childitem

get-computerrestorepoint

get-content

get-controlpanelitem

get-eventlog

get-hotfix

get-item

get-itemproperty

get-location

get-process

get-psdrive

get-psprovider

get-service

get-transaction

get-wmiobject

invoke-item

invoke-wmimethod

join-path

limit-eventlog

move-item

move-itemproperty

new-eventlog

new-item

new-itemproperty

new-psdrive

new-service

new-webserviceproxy

pop-location

push-location

register-wmievent

remove-computer

remove-eventlog

remove-item

remove-itemproperty

remove-psdrive

remove-wmiobject

rename-computer

rename-item

rename-itemproperty

reset-computermachinepassword

resolve-path

restart-computer

restart-service

restore-computer

resume-service

set-content

set-item

set-itemproperty

set-location

set-service

set-wmiinstance

show-controlpanelitem

show-eventlog

split-path

start-process

start-service

start-transaction

stop-computer

stop-process

stop-service

suspend-service

test-computersecurechannel

test-connection

test-path

undo-transaction

use-transaction

wait-process

write-eventlog

add-member

add-type

clear-variable

compare-object

convertfrom-csv

convertfrom-json

convertfrom-stringdata

convertto-csv

convertto-html

convertto-json

convertto-xml

disable-psbreakpoint

enable-psbreakpoint

export-alias

export-clixml

export-csv

export-formatdata

export-pssession

format-custom

format-list

format-table

format-wide

get-alias

get-culture

get-date

get-event

get-eventsubscriber

get-formatdata

get-host

get-member

get-psbreakpoint

get-pscallstack

get-random

get-tracesource

get-typedata

get-uiculture

get-unique

get-variable

group-object

import-alias

import-clixml

import-csv

import-localizeddata

import-pssession

invoke-expression

invoke-restmethod

invoke-webrequest

measure-command

measure-object

new-alias

new-event

new-object

new-timespan

new-variable

out-file

out-gridview

out-printer

out-string

read-host

register-engineevent

register-objectevent

remove-event

remove-psbreakpoint

remove-typedata

remove-variable

select-object

select-string

select-xml

send-mailmessage

set-alias

set-date

set-psbreakpoint

set-tracesource

set-variable

show-command

sort-object

start-sleep

tee-object

trace-command

unblock-file

unregister-event

update-formatdata

update-list

update-typedata

wait-event

write-debug

write-error

write-host

write-output

write-progress

write-verbose

write-warning

set-applockerpolicy

get-applockerpolicy

test-applockerpolicy

get-applockerfileinformation

new-applockerpolicy

add-bitsfile

remove-bitstransfer

complete-bitstransfer

get-bitstransfer

start-bitstransfer

resume-bitstransfer

set-bitstransfer

suspend-bitstransfer

get-ciminstance

get-cimsession

new-cimsession

new-cimsessionoption

remove-cimsession

get-cimassociatedinstance

get-cimclass

invoke-cimmethod

new-ciminstance

register-cimindicationevent

remove-ciminstance

set-ciminstance

resolve-dnsname

resolve-dnsname

get-kdsrootkey

add-kdsrootkey

test-kdsrootkey

get-kdsconfiguration

set-kdsconfiguration

clear-kdscache

get-winevent

get-counter

import-counter

export-counter

new-winevent

start-transcript

stop-transcript

get-acl

set-acl

get-pfxcertificate

get-credential

get-executionpolicy

set-executionpolicy

get-authenticodesignature

set-authenticodesignature

convertfrom-securestring

convertto-securestring

disable-wsmancredssp

enable-wsmancredssp

get-wsmancredssp

set-wsmanquickconfig

test-wsman

invoke-wsmanaction

connect-wsman

disconnect-wsman

get-wsmaninstance

set-wsmaninstance

remove-wsmaninstance

new-wsmaninstance

new-wsmansessionoption

new-dtcdiagnostictransaction

complete-dtcdiagnostictransaction

join-dtcdiagnosticresourcemanager

receive-dtcdiagnostictransaction

send-dtcdiagnostictransaction

start-dtcdiagnosticresourcemanager

stop-dtcdiagnosticresourcemanager

undo-dtcdiagnostictransaction

new-netauthenticationproposal

new-netmainmodecryptoproposal

new-netquickmodecryptoproposal

get-dapolicychange

get-autoenrollmentpolicy

set-autoenrollmentpolicy

export-certificate

import-certificate

get-certificate

switch-certificate

import-pfxcertificate

export-pfxcertificate

test-certificate

new-certificatenotificationtask

get-certificatenotificationtask

remove-certificatenotificationtask

add-enrollmentpolicyserver

get-enrollmentpolicyserver

remove-enrollmentpolicyserver

new-selfsignedcertificate

get-pfxdata

new-jobtrigger

add-jobtrigger

remove-jobtrigger

get-jobtrigger

set-jobtrigger

enable-jobtrigger

disable-jobtrigger

new-scheduledjoboption

get-scheduledjoboption

set-scheduledjoboption

register-scheduledjob

get-scheduledjob

set-scheduledjob

unregister-scheduledjob

enable-scheduledjob

disable-scheduledjob

import-psworkflow

new-psworkflowexecutionoption

new-jobtrigger

add-jobtrigger

remove-jobtrigger

get-jobtrigger

set-jobtrigger

enable-jobtrigger

disable-jobtrigger

new-scheduledjoboption

get-scheduledjoboption

set-scheduledjoboption

register-scheduledjob

get-scheduledjob

set-scheduledjob

unregister-scheduledjob

enable-scheduledjob

disable-scheduledjob

confirm-securebootuefi

set-securebootuefi

get-securebootuefi

format-securebootuefi

test-securebootpolicy

repair-securebootpolicy

convertfrom-securebootpolicy

install-securebootpolicy

get-troubleshootingpack

invoke-troubleshootingpack

get-tpm

initialize-tpm

clear-tpm

unblock-tpm

enable-tpmautoprovisioning

disable-tpmautoprovisioning

import-tpmownerauth

set-tpmownerauth

convertto-tpmownerauth

四、powershell 3.0基础命令快速参考

connect-pssession

convertfrom-json

convertto-json

disable-psremoting

disconnect-pssession

export-cimcommand

get-controlpanelitem

get-typedata

invoke-restmethod

invoke-webrequest

new-pssessionconfigurationfile

new-pstransportoption

new-winevent

receive-pssession

register-jobevent

remove-typedata

rename-computer

resume-job

save-help

show-command

show-controlpanelitem

suspend-job

test-pssessionconfigurationfile

unblock-file

update-help

connect-pssession aliases cnsn

syntax

connect-pssession [-computername] <string[]> [-credential <pscredential>] [-authentication

<authenticationmechanism> {default | basic | negotiate | negotiatewithimplicitcredential | credssp | digest |

kerberos}] [-certificatethumbprint <string>] [-port <int>] [-usessl] [-sessionoption <pssessionoption>]

[-throttlelimit <int>] [-whatif] [-confirm] [<commonparameters>]

connect-pssession [-session] <pssession[]> [-sessionoption <pssessionoption>] [-throttlelimit <int>] [-whatif]

[-confirm] [<commonparameters>]

connect-pssession [-computername] <string[]> -instanceid <guid[]> [-credential <pscredential>] [-authentication

<authenticationmechanism> {default | basic | negotiate | negotiatewithimplicitcredential | credssp | digest |

kerberos}] [-certificatethumbprint <string>] [-port <int>] [-usessl] [-sessionoption <pssessionoption>]

[-throttlelimit <int>] [-whatif] [-confirm] [<commonparameters>]

connect-pssession [-computername] <string[]> -name <string[]> [-credential <pscredential>] [-authentication

<authenticationmechanism> {default | basic | negotiate | negotiatewithimplicitcredential | credssp | digest |

kerberos}] [-certificatethumbprint <string>] [-port <int>] [-usessl] [-sessionoption <pssessionoption>]

[-throttlelimit <int>] [-whatif] [-confirm] [<commonparameters>]

connect-pssession [-id] <int[]> [-sessionoption <pssessionoption>] [-throttlelimit <int>] [-whatif] [-confirm]

[<commonparameters>]

convertfrom-json aliases none

syntax

convertfrom-json [-inputobject] <string> [<commonparameters>]

convertto-json aliases none

syntax

convertto-json [-inputobject] <object> [-depth <int>] [-compress] [<commonparameters>]

disable-psremoting aliases none

syntax

disable-psremoting [-force] [-whatif] [-confirm] [<commonparameters>]

disconnect-pssession aliases dnsn

syntax

disconnect-pssession [-session] <pssession[]> [[-sessionoption] <pssessionoption>] [[-throttlelimit] <int>]

[-whatif] [-confirm] [<commonparameters>]

disconnect-pssession [[-sessionoption] <pssessionoption>] [[-throttlelimit] <int>] [-instanceid <guid[]>]

[-whatif] [-confirm] [<commonparameters>]

disconnect-pssession [[-computername] <string[]>] [[-sessionoption] <pssessionoption>] [[-throttlelimit] <int>]

[-whatif] [-confirm] [<commonparameters>]

disconnect-pssession [[-sessionoption] <pssessionoption>] [[-throttlelimit] <int>] [-name <string[]>] [-whatif]

[-confirm] [<commonparameters>]

disconnect-pssession [-id] <int[]> [[-sessionoption] <pssessionoption>] [[-throttlelimit] <int>] [-whatif]

[-confirm] [<commonparameters>]

export-cimcommand aliases none

syntax

export-cimcommand [-cmdletdefinitionpath] <string> [-outputmodule <string>] [-force] [-encoding <string>]

[-typespath <string>] [-formatpath <string>] [-helppath <string>] [-useoldsystemmanagementapi] [<commonparameters>]

get-controlpanelitem aliases none

syntax

get-controlpanelitem [[-name] <string[]>] [-category <string[]>] [<commonparameters>]

get-controlpanelitem -canonicalname <string[]> [-category <string[]>] [<commonparameters>]

get-typedata aliases none

syntax

get-typedata [[-typename] <string[]>] [<commonparameters>]

invoke-restmethod aliases irm

syntax

invoke-restmethod [-uri] <uri> [-method <webrequestmethod> {default | get | head | post | put | delete | trace |

options}] [-returntype <restreturntype> {detect | json | xml}] [-session <webrequestsession>] [-sessionvariable

<string>] [-credential <pscredential>] [-usedefaultcredentials] [-certificatethumbprint <string>] [-certificate

<x509certificate>] [-useragent <string>] [-disablekeepalive] [-timeout <int>] [-headers <idictionary>]

[-maximumredirection <int>] [-proxy <uri>] [-proxycredential <pscredential>] [-proxyusedefaultcredentials] [-body

<object>] [-contenttype <string>] [-transferencoding <string>] [-infile <string>] [-outfile <string>] [-passthru]

[<commonparameters>]

invoke-webrequest aliases iwr

syntax

invoke-webrequest [-uri] <uri> [-usebasicparsing] [-session <webrequestsession>] [-sessionvariable <string>]

[-credential <pscredential>] [-usedefaultcredentials] [-certificatethumbprint <string>] [-certificate

<x509certificate>] [-useragent <string>] [-disablekeepalive] [-timeout <int>] [-headers <idictionary>]

[-maximumredirection <int>] [-method <webrequestmethod> {default | get | head | post | put | delete | trace |

options}] [-proxy <uri>] [-proxycredential <pscredential>] [-proxyusedefaultcredentials] [-body <object>]

[-contenttype <string>] [-transferencoding <string>] [-infile <string>] [-outfile <string>] [-passthru]

[<commonparameters>]

new-pssessionconfigurationfile aliases none

syntax

new-pssessionconfigurationfile [-path] <string> [-schemaversion <version>] [-guid <guid>] [-author <string>]

[-companyname <string>] [-copyright <string>] [-description <string>] [-powershellversion <version>] [-sessiontype

<sessiontype> {empty | restrictedremoteserver | default}] [-modulestoimport <string[]>] [-assembliestoload

<string[]>] [-visiblealiases <string[]>] [-visiblecmdlets <string[]>] [-visiblefunctions <string[]>]

[-visibleproviders <string[]>] [-visiblevariables <string[]>] [-aliasdefinitions <hashtable[]>]

[-functiondefinitions <hashtable[]>] [-variabledefinitions <hashtable[]>] [-environmentvariables <object>]

[-typestoprocess <string[]>] [-formatstoprocess <string[]>] [-languagemode <pslanguagemode> {fulllanguage |

restrictedlanguage | nolanguage}] [-executionpolicy <executionpolicy> {unrestricted | remotesigned | allsigned |

restricted | default | bypass | undefined}] [-scriptstoprocess <string[]>] [<commonparameters>]

new-pstransportoption

syntax

new-pstransportoption [-maxidletimeout <int>] [-processidletimeout <int>] [-maxsessions <int>]

[-maxconcurrentcommandspersession <int>] [-reservedconcurrentcommandspersession <int>] [-maxsessionsperuser <int>]

[-maxmemorypersessionmb <int>] [-maxprocessespersession <int>] [-maxconcurrentusers <int>] [-idletimeout <int>]

[-outputbufferingmode <outputbufferingmode>] [<commonparameters>]

new-winevent

syntax

new-winevent [-providername] <string> [-id] <int> [[-payload] <object[]>] [-version <byte>] [-force]

[<commonparameters>]

receive-pssession aliases rcsn

syntax

receive-pssession [-session] <pssession> [-outtarget <outtarget> {default | host | job}] [-jobname <string>]

[-whatif] [-confirm] [<commonparameters>]

receive-pssession [[-id] <int>] [-outtarget <outtarget> {default | host | job}] [-jobname <string>] [-whatif]

[-confirm] [<commonparameters>]

receive-pssession [[-computername] <string>] [-name <string>] [-outtarget <outtarget> {default | host | job}]

[-jobname <string>] [-credential <pscredential>] [-authentication <authenticationmechanism> {default | basic |

negotiate | negotiatewithimplicitcredential | credssp | digest | kerberos}] [-certificatethumbprint <string>]

[-port <int>] [-usessl] [-whatif] [-confirm] [<commonparameters>]

receive-pssession [[-computername] <string>] [[-instanceid] <guid>] [-outtarget <outtarget> {default | host |

job}] [-jobname <string>] [-credential <pscredential>] [-authentication <authenticationmechanism> {default | basic

| negotiate | negotiatewithimplicitcredential | credssp | digest | kerberos}] [-certificatethumbprint <string>]

[-port <int>] [-usessl] [-whatif] [-confirm] [<commonparameters>]

receive-pssession [[-instanceid] <guid>] [-outtarget <outtarget> {default | host | job}] [-jobname <string>]

[-whatif] [-confirm] [<commonparameters>]

receive-pssession [-name <string>] [-outtarget <outtarget> {default | host | job}] [-jobname <string>] [-whatif]

[-confirm] [<commonparameters>]

register-jobevent

syntax

register-jobevent [-inputjobobject] <job> [-eventname] <string> [[-sourceidentifier] <string>] [[-action]

<scriptblock>] [-messagedata <psobject>] [-supportevent] [-forward] [<commonparameters>]

remove-typedata

syntax

remove-typedata -typedata <typedata> [-whatif] [-confirm] [<commonparameters>]

remove-typedata [-typename] <string> [-whatif] [-confirm] [<commonparameters>]

remove-typedata [-path <string[]>] [-whatif] [-confirm] [<commonparameters>]

rename-computer

syntax

rename-computer [-newname] <string> [-computername <string>] [-passthru] [-domaincredential <pscredential>]

[-localcredential <pscredential>] [-force] [-restart] [-whatif] [-confirm] [<commonparameters>]

resume-job aliases rujb

syntax

resume-job [-id] <int[]> [-passthru] [-whatif] [-confirm] [<commonparameters>]

resume-job [-job] <job[]> [-passthru] [-whatif] [-confirm] [<commonparameters>]

resume-job [[-name] <string[]>] [-passthru] [-whatif] [-confirm] [<commonparameters>]

resume-job [[-instanceid] <guid[]>] [-passthru] [-whatif] [-confirm] [<commonparameters>]

resume-job [-passthru] [-state <jobstate> {notstarted | running | completed | failed | stopped | blocked |

suspended | disconnected | suspending | stopping}] [-whatif] [-confirm] [<commonparameters>]

resume-job [-passthru] [-filter <hashtable>] [-whatif] [-confirm] [<commonparameters>]

save-help

syntax

save-help [[-destinationpath] <string[]>] [[-uiculture] <string[]>] [-force] [<commonparameters>]

save-help [[-destinationpath] <string[]>] [[-inputobject] <psmoduleinfo[]>] [[-uiculture] <string[]>]

[-literalpath <string[]>] [-force] [<commonparameters>]

save-help [[-destinationpath] <string[]>] [[-module] <string[]>] [[-uiculture] <string[]>] [-literalpath

<string[]>] [-force] [<commonparameters>]

save-help [[-uiculture] <string[]>] [-literalpath <string[]>] [-force] [<commonparameters>]

show-command

syntax

show-command [[-name] <string>] [-height <double>] [-width <double>] [-nocommonparameter] [-noerrorpopup]

[<commonparameters>]

show-controlpanelitem

syntax

show-controlpanelitem [-name] <string[]> [<commonparameters>]

show-controlpanelitem -canonicalname <string[]> [<commonparameters>]

show-controlpanelitem [[-inputobject] <controlpanelitem[]>] [<commonparameters>]<strong></strong>

suspend-job aliases sujb

syntax

suspend-job [-id] <int[]> [-passthru] [-whatif] [-confirm] [<commonparameters>]

suspend-job [-job] <job[]> [-passthru] [-whatif] [-confirm] [<commonparameters>]

suspend-job [[-name] <string[]>] [-passthru] [-whatif] [-confirm] [<commonparameters>]

suspend-job [[-instanceid] <guid[]>] [-passthru] [-whatif] [-confirm] [<commonparameters>]

suspend-job [-passthru] [-state <jobstate> {notstarted | running | completed | failed | stopped | blocked |

suspended | disconnected | suspending | stopping}] [-whatif] [-confirm] [<commonparameters>]

suspend-job [-passthru] [-filter <hashtable>] [-whatif] [-confirm] [<commonparameters>]

test-pssessionconfigurationfile

syntax

test-pssessionconfigurationfile [-path] <string> [<commonparameters>]

unblock-file

syntax

unblock-file [-path] <string[]> [-whatif] [-confirm] [<commonparameters>]

unblock-file [-literalpath] <string[]> [-whatif] [-confirm] [<commonparameters>]

update-help

syntax

update-help [[-sourcepath] <string[]>] [[-uiculture] <string[]>] [-literalpath <string[]>] [-recurse] [-force]

[<commonparameters>]

update-help [[-module] <string[]>] [[-sourcepath] <string[]>] [[-uiculture] <string[]>] [-literalpath <string[]>]

[-recurse] [-force] [<commonparameters>]

update-help [[-inputobject] <psmoduleinfo[]>] [[-sourcepath] <string[]>] [[-uiculture] <string[]>] [-literalpath

<string[]>] [-recurse] [-force] [<commonparameters>]

五、最后写几个命令

查看目前加载的所有模块:get-module –all

Windows 8 中的 PowerShell 3.0

查看scheduledtasks模块包含的所有命令:get-command –module scheduledtasks

Windows 8 中的 PowerShell 3.0

小结:

windows 8包含的powershell 3.0进行了很大的更新,尤其在windows server 8中,几乎所有的管理工作都可以使用powershell来完成,甚至一部分管理只能用powershell。后续篇章会继续在windows 8中测试powershell 3.0,体验企业级的自动化管理任务。

相关标签: PowerShell 3.0