Vous êtes sur la page 1sur 7

Powershell

for Beginners
ThequestionsandanswersweredevelopedstraightfromtheMicrosoftTechnetpagesandIhave includedlinksforeachtopic. ThepurposeofthiscrosswordwastohopefullyintroducesomereluctantAdministratorstoPowershell. Powershellwillbeamandatoryrequirementintheverynearfuture,ifitisnotalreadyinyourarea. IfyoufindthatPowershellcan will!makeyourlifemucheasier,thenIwouldhighlysuggesttheselinks toopenyourmindandyourworldtoPowershell.

The Lonely Administrator "#effery$icks IamcertifiedMicrosoftprofessional,aMicrosoftM%PandanITveteranwithalmost&'yearsof e(perience,muchofitspentasanITconsultantspeciali)ingin*indowsservertechnologies. http+,,-dhitsolutions.com,blog, Concentrated Technology is the brainchild of IT gurus Don Jones and Greg Shields. We
offer a number of different products and services, depending on which part of the IT industry you wor in. http!""www.concentratedtech.com"

Claus Nielsen http+,,(ipher.dk vSphere PowerCLI Thebestautomationtoolfor%Mwarev.phere Intertube.erial/0123142156http+,,www.vmware.com,go,powercli Powershell - Bruce Payette ql unction http+,,learningpcs.blogspot.com,&'11,'1,powershell"bruce"payette"ql"function.html !mitry Sotni"ovMybackgroundincludesvariouspositionsin.oftware7evelopment,Technical 8ommunications,Technical.upport wassettingup&493phonesupportinAelita.oftware:thatwasa fun-ob;!,ProductManagement,andnow<ewProduct=esearch. http+,,dmitrysotnikov.wordpress.com,about,

Powershell For Beginners


Tim Bolton
1 3 4 5 2

6 8 9 10

11 12 13 14 16 15

17

18

19

20 21 22 23

24 25 26 27

28

29

30

31 32

Across 1. In Windows PowerShell, there are two types of errors: BLANK and Non-terminatin . !. BLANK-BLANK "mdlet #ses s"ript $lo"%s and the &' des"riptor for the "#rrent pipeline o$(e"t to let yo# r#n a "ommand on ea"h o$(e"t in the pipeline. ). A BLANK is a pa"%a e of "ommands and other items that yo# "an #se in Windows PowerShell. 1*. +sin ,Sphere Power-LI to list all the ,Sphere Ser,ers ./01ost2 on the "onne"ted ,Sphere Ser,er and some of their properties BLANK 13. We "an or ani4e displayed data to ma%e it easier to s"an $y #sin the BLANK-BLANK "mdlet. 15. +sin ,Sphere Power-LI to list all the snapshots for all ,irt#al ma"hines BLANK 6 7et-Snapshot 1). BLANK BLANK pro,ides a#tomati" 1elp when yo# are typin in the S"ript Pane or in the -ommand Pane. 18. 9o# "an et the ser,i"es on a lo"al or remote "omp#ter $y #sin the BLANK-BLANK "mdlet. 1:. BLANK-BLANK is the most important "mdlet for eneral system mana ement tas%s. 1;. BLANK are a type of "ommand in Windows PowerShell. <he $est thin a$o#t BLANK is that they are really easy to write. 33. <o determine the path of yo#r "#rrent dire"tory lo"ation, enter the BLANK-BLANK "ommand. 3=. -mdlets +se BLANK-BLANK Names to >ed#"e -ommand 0emori4ation. 3:. BLANK a"t li%e a series of "onne"ted se ments of pipe. Items mo,in alon the pipeline pass thro# h ea"h se ment. 3;. Altho# h yo# mi ht not reali4e it at first, when yo# wor% in Windows PowerShell, yo# are wor%in with .N?< @ramewor% BLANK. 5*. <he defa#lt eAe"#tion poli"y, BLANK, is the most se"#re of the eAe"#tion poli"ies. 51. ,Sphere BLANK is a set of snapins $ased on Windows PowerShell that pro,ide administration and a#tomation for /0ware ,Sphere. 53. A Windows PowerShell BLANK is a dynami" lin% li$rary ..dll2 that implements "mdlets and pro,iders.

Down 3. <o find the eAe"#tion poli"y on yo#r system, type: BLANK-BLANK 5. A BLANK is a sin le-feat#re "ommand that manip#lates o$(e"ts in Windows PowerShell. =. BLANK-BLANK formats file "ontents to loo% li%e "onsole o#tp#t. <his "a#ses the o#tp#t to $e tr#n"ated (#st as it is in a "onsole window in most "ir"#mstan"es. 8. <o see a list of Windows PowerShell dri,es, type: BLANK-BLANK :. BLANK-BLANK, is one of the most #sef#l for doin real wor% ,ia W0I. ;. BLANK-BLANK "on,erts o$(e"ts into a series of "omma-separated .-S/2 strin s and sa,es the strin s in a -S/ file. 1*. Bne of the most #sef#l "mdlets is BLANK-BLANK, whi"h displays information a$o#t the .N?< @ramewor% o$(e"t. 11. BLANK-BLANK ets the e,ents in an e,ent lo , or a list of the e,ent lo s, on the lo"al or remote "omp#ters. 15. <he BLANK-BLANK "mdlet is desi ned spe"ifi"ally to ret#rn all items fo#nd within a "ontainer s#"h as a folder. 1!. In addition to its intera"ti,e interfa"e, Windows PowerShell f#lly s#pports s"riptin . In Windows PowerShell, s"ript files ha,e a BLANK file name eAtension. 1=. <o et a list of a,aila$le -mdlets in yo#r Powershell "onsole %ey in BLANK-BLANK 6 0B>? <his will let #s step thro# h and ,iew the pa es f#ll of -ontent. 1:. <o et the pro"esses r#nnin on the lo"al "omp#ter, r#n a BLANK-BLANK with no parameters. 3*. <he BLANK-BLANK "ommand allows yo# to spe"ify yo#r "#rrent dire"tory lo"ation. 31. PowerShell lets yo# "reate BLANK - essentially named o$(e"ts - to preser,e o#tp#t to #se later. 35. Windows PowerShell s#pports the "on"ept of an BLANK, that is, an alternate name for a "ommand. 3!. <o et 1elp a$o#t Windows PowerShell "mdlets, #se the BLANK-BLANK "mdlet. 3). BLANK "ontains the en#merator of a forea"h-o$(e"t loop. 38. 9o# "an "reate one or more Windows PowerShell BLANK for Windows PowerShell IS? and #se them to add the ,aria$les, aliases, "ommands and f#n"tions that yo# #se freC#ently.

ACROSS

1)ErrorswilloccuroccasionallywhenyouusetheWindowsPowerShell,suchaswhenyouare tryingtosetyourlocationtoanonexistentdirectoryortryingtoremoveafilewithoutthe requiredprivileges. nWindowsPowerShell,therearetwotypesoferrors!Terminating errors! Errorsthathalttheexecutionofthecommand."Non-terminatingerrors!Errorsthatdonot halttheexecutionofthecommand.http!##technet.microsoft.com#en$ us#li%rary#%%&'(&)*+,S.(-).aspx ').heForEach-Objectcmdletusesscript%loc/sandthe01descriptorforthecurrentpipeline o%2ecttoletyourunacommandoneacho%2ectinthepipeline..hiscan%eusedtoperform somecomplicatedtas/s.http!##technet.microsoft.com#en$us#li%rary#dd3'4414.aspx &)5moduleisapac/ageofcommandsandotheritemsthatyoucanuseinWindows PowerShell.5fteryourunthesetupprogramorsavethemoduletodis/,youcanimportthe moduleintoyourWindowsPowerShellsessionandusethecommandsanditems.6oucanalso usemodulestoorgani7ethecmdlets,providers,functions,aliases,andothercommandsthat youcreate,andsharethemwithothers.http!##technet.microsoft.com#en$ us#li%rary#dd4'-)31+,S.(-).aspx 1))8singvSpherePower9: tolistallthevSphereServers+,;<ost)ontheconnectedvSphere ServerandsomeoftheirpropertiesGet-VMHo t http!##communities.vmware.com#docs#=>9$ 134)) 1*)Wecanorgani7edisplayeddatatoma/eiteasiertoscan%yusingtheSort-Objectcmdlet. http!##technet.microsoft.com#en$us#li%rary#dd3'441(.aspx 13)8singvSpherePower9: tolistallthesnapshotsforallvirtualmachinesGet-VM?@et$ Snapshothttp!##communities.vmware.com#docs#=>9$134)) 1&)Tab com!letionprovidesautomatic<elpwhenyouaretypingintheScriptPaneorinthe 9ommandPane.http!##technet.microsoft.com#en$us#li%rary#dd(1A'-4.aspx 14)6oucangettheservicesonalocalorremotecomputer%yusingtheGet-Ser"icecmdlet. http!##technet.microsoft.com#en$us#li%rary#dd31-*3A.aspx 1()Get-#miObject isthemostimportantcmdletforgeneralsystemmanagementtas/s.5ll criticalsu%systemsettingsareexposedthroughW; .Burthermore,W; treatsdataaso%2ects thatareincollectionsofoneormoreitems.http!##technet.microsoft.com#en$ us#li%rary#dd31-*').aspx

19)FunctionsareatypeofcommandinWindowsPowerShell.Thebestthingabout functionsis thattheyarereallyeasytowrite.Unlikecmdlets whicharewrittenin!" functionsare#usta namedgroupingofWindowsPowerShellcommandsande$pressions.%fyoucantypecommands inWindowsPowerShell youcanwritefunctions.http&''technet.microsoft.com'en( us'library'dd)*+,-,./S.0+).asp$ 11)Todeterminethepathofyourcurrentdirectorylocation entertheGet-Locationcommand http&''technet.microsoft.com'en(us'library'dd-1+121.asp$ 1+)!mdletsUseVerb-Noun3amesto4educe!ommand5emori6ation. http&''technet.microsoft.com'en(us'library'dd-1+-1+.asp$ 10)Pipelinesactlikeaseriesofconnectedsegmentsofpipe.%temsmo7ingalongthe pipeline passthrougheachsegment.TocreateapipelineinWindowsPowerShell youconnect commandstogetherwiththepipeoperator898.Theoutputofeachcommandisusedasinputto thene$tcommand.http&''technet.microsoft.com'en(us'library'dd-*)2++.asp$ 19):lthoughyoumightnotreali6eitatfirst whenyouworkinWindowsPowerShell youare workingwith.3;T<rameworkobjects.:syougaine$perience thepowerofob#ectprocessing becomesmoree7ident andyou=llfindyourselfusingtheobjectsande7enthinkinginob#ects. http&''technet.microsoft.com'en(us'library'bb21-*0)./S.0+).asp$ -,)Thedefaulte$ecutionpolicy Restricted isthemostsecureofthee$ecutionpolicies.%tdoes notpermitanyscriptstorun anditdoesnotpermitanyconfigurationfiles includinga WindowsPowerShellprofile tobeloaded.>oucanstilluseWindowsPowerShellinteracti7ely. http&''technet.microsoft.com'en(us'library'bb2*02,1./S.0+).asp$ -1)7SpherePowerCLIisasetofsnapinsbasedonWindowsPowerShellthatpro7ide administrationandautomationfor/5ware7Sphere.7SpherePower!?%shipswitho7er1,, commandlets.pre(builtcommands)tohelpadministratorsmanage7Sphere. http&''communities.7mware.com'community'7mtn'ser7er'7sphere'automationtools'powercli -1):WindowsPowerShellsnap-in.PSSnapin)isadynamiclinklibrary..dll)thatimplements cmdletsandpro7iders.Whenyourecei7easnap(in youneedtoinstallit andthenyoucanadd thecmdletsandpro7idersinthesnap(intoyourWindowsPowerShellsession. http&''technet.microsoft.com'en(us'library'dd)*+,-1./S.0+).asp$

DOWN 2)Tofindtheexecutionpolicyonyoursystem,type:getexecutionpolicy http://technet.microsoft.com/enus/library/bb6486 !"#$.8%).aspx &)'Cmdletisasin(lefeaturecommandthatmanipulatesob)ectsin*indo+s,o+er$hell. http://technet.microsoft.com/enus/library/bb648%-."#$.8%).aspx %)Outfileformatsfilecontentstoloo/li/econsoleoutput.Thiscausestheoutputtobe truncated)ustasitisinaconsole+indo+inmostcircumstances. http://technet.microsoft.com/enus/library/dd&4.%8%.aspx .)*indo+s,o+er$hellcomes+ithse0eralusefuldri0es+hicharesupportedby*indo+s ,o+er$hellpro0iders.Toseealistof*indo+s,o+er$helldri0es,type: getpsdrive http://technet.microsoft.com/enus/library/ms.!44!."#$.8%).aspx 8)*indo+s1ana(ement2nstrumentation"*12)isacoretechnolo(yfor*indo+ssystem administrationbecauseitexposesa+ideran(eofinformationinauniformmanner.3ecauseof ho+much*12ma/espossible,the*indo+s,o+er$hellcmdletforaccessin(*12ob)ects, GetWmiObject,isoneofthemostusefulfordoin(real+or/. http://technet.microsoft.com/enus/library/dd&!%&.-.aspx -)ExportCSV4on0ertsob)ectsintoaseriesofcommaseparated"4$#)strin(sandsa0esthe strin(sina4$#file.http://technet.microsoft.com/enus/library/dd&4..24.aspx ! )5neofthemostusefulcmdletsisGet ember,+hichdisplaysinformationaboutthe.67T 8rame+or/ob)ectthatacommandreturns.Theinformationincludesthetype,properties,and methodsoftheob)ect.http://technet.microsoft.com/enus/library/bb6!&48 "#$.8%).aspx !!)GetEvent!og9etsthee0entsinane0entlo(,oralistofthee0entlo(s,onthelocalor remotecomputers.http://technet.microsoft.com/enus/library/dd&!%2% .aspx !&)TheGetC"ild#temcmdletisdesi(nedspecificallytoreturnallitemsfound+ithina containersuchasafolder.http://technet.microsoft.com/enus/library/dd&!%&8!.aspx !4)2nadditiontoitsinteracti0einterface,*indo+s,o+er$hellfullysupportsscriptin(.2n *indo+s,o+er$hell,scriptfilesha0ea $ps%filenameextension. http://technet.microsoft.com/enus/library/bb6!&48!"#$.8%).aspx !%)To(etalistofa0ailable4mdletsinyour,o+ershellconsole/eyin Get CO 15;7This+illletusstepthrou(hand0ie+thepa(esfullof4ontent. http://technet.microsoft.com/enus/library/dd&4.6-6.aspx &ND:

!8)To(ettheprocessesrunnin(onthelocalcomputer,runaGet'rocess+ithnoparameters. http://technet.microsoft.com/enus/library/dd&4.6% .aspx

2 )TheSetLocationcommandallo+syoutospecifyyourcurrentdirectorylocation. http://technet.microsoft.com/enus/library/ee!.6-62.aspx 2!)*indo+s,o+er$hell+or/s+ithob)ects.*indo+s,o+er$hellletsyoucreate variables essentiallynamedob)ectstopreser0eoutputtouselater.http://technet.microsoft.com/en us/library/dd&!%& %.aspx 2&)4mdletnamescanbecumbersometotype.Tominimi<etypin(,andtoma/eiteasierfor usersaccustomedtoothershellstouse*indo+s,o+er$hell,*indo+s,o+er$hellsupports theconceptofanalias,thatis,analternatenameforacommand.=oucancreatean aliasfora cmdletname,functionname,orthenameofanexecutablefile,andthentypethealiasinstead ofthenameinanycommand.http://technet.microsoft.com/en us/library/bb6486 &"#$.8%).aspx 24)To(et>elpabout*indo+s,o+er$hellcmdlets,usetheGetHelpcmdlet. http://technet.microsoft.com/enus/library/dd&4.68-.aspx 26)$ForEach4ontainstheenumeratorofaforeachob)ectloop. http://technet.microsoft.com/enus/library/dd&4.6.%.aspx 2.)=oucancreateoneormore*indo+s,o+er$hell profilesfor*indo+s,o+er$hell2$7and usethemtoaddthe0ariables,aliases,commandsandfunctionsthatyouusefre?uently.' profileaffectse0ery*indo+s,o+er$hell2$7sessionthatyoustart.=oucanalsousea profileto preser0etheitemsthatyoucustomi<einthe*indo+s,o+er$hell2$7en0ironment,suchas colorandfontpreferences.http://technet.microsoft.com/enus/library/dd8!-4&4.aspx

Vous aimerez peut-être aussi