1 of 18

Windows commands line and PowerShell environment

2 of 18

Lecture 5 . Windows PowerShell

  1. About
  2. PowerShell commands
  3. PowerShell update
  4. Processes in PowerShell see

3 of 18

1. About

  • PowerShell is interactive , object directed command environment , script of the language PowerShell 1.0 was officially released by Microsoft on November 14 , 2006 . speakers usual the interface united command CLI local array and far networks management for .NET Framework.
  • Windows PowerShell is simple operational shell Microsoft is not specific . script language as working powerful , scalable , but flexible management automation tool created .
  • On August 18 , 2016 , Microsoft Windows PowerShell was no longer every one working issuer for open source product that announcement The company also developed a Unix - based operational systems supported .

4 of 18

  • Windows PowerShell 2.0 operating system of the system inseparable part as Windows 7, Windows 8, Windows Server 2008 R2 and Windows Server 2012 R2 OS adding was released .
  • PowerShell was originally part of the Microsoft .NET Framework one part as working issued and later with .NET Core combined .
  • PowerShell for administrators local and remote in systems different kind tasks complete can only environment create for orders to do opportunity gives .
  • This administrative tasks usually in custom .NET classes commandlets ( using cmdlets) done is increased .

5 of 18

PowerShell ISE

6 of 18

  1. Help get . Shell built-in cmdlet. Get-Help Get-Process in PowerShell.
  2. The content get . New beginners and system administrators for files reading order simplifies . If previously handle open and of the document all lines one by one reading need if so , now file to cmdlet transfer enough . This is enough. for to the console C: \> Get-Content C: \ ... \ " file Type " name ". " Extension ".
  3. Get-Service. On the computer installed services about information to take .
  4. Registration By the transition . cmdlet returned object about information gives and his/her features and methods to see opportunity gives .
  5. Get- Command . Cmdlets they are looking for about all information , that including functions , scripts , applications and other elements about information returns . In PowerShell version 5.0 for Windows 10 , version column added to Get-Command and now CommandDet one of time in itself one kind module one how many version shows .
  6. Stop -\Start- Service.Administrators for unchanging helper . Cmdlet remote and local on computers services to work lowers and stops .

For PowerShell necessary orders and instructions list

7 of 18

  • PowerShell ( abbreviation PS) program mainly administrators and programmers for intended .
  • This is in the OS all of tasks to automate about 99% opportunity gives . Its using you remote computers configure , services to work your discharge and again you like and many server applications your storage possible .
  • User different kind constructions , commands command line utilities.NET classes , WMI (Windows Management Instrumentation) or COM (Component Object Model) objects appeal as commandlets integration in scripts ( scenarios ) through many administrative deeds to do possible .
  • From this except by PowerShell providers by presented attainable file system or Windows registry to take book such as different kind information from the bases your use possible .

8 of 18

PowerShell​ how management need�

  • There are currently over 130 in the PowerShell Automation tool module and orders installed . They files , networks , directories to take book , management and other system to the possibilities to enter provides :
  • time and date to mark ;
  • folders and separately files with work ;
  • help and additional information to take ;
  • import data​ and storage ;
  • script methods ;
  • separately scripts and applications ;
  • system safety check and descriptors with work ;
  • system management ;
  • on disk empty place check . ,.....................

9 of 18

Windows PowerShell Extensible environment that into account users​​ own orders creation , .Net language " authoring " modules using to write possible .

10 of 18

With PowerShell to work start

  • PowerShell​ the last 6.0 beta version was released in 2016 released . Assistant in Windows 7, 8 and 10 program installed . If you other operational from the system using if you are , the program download you can get need It will be . for microfoft.com official to the website go and search Type Windows PowerShell into the field install - ni Enter . System you automatic accordingly the most new product removable to the page take Go to the OS . choose and Download to take - to click .
  • File complete after loading after him/her open for him/her two times Click . Default environment​​ Installed in ProgramFiles \PowerShell\ and To work unloading in the menu label is created .

11 of 18

  • PowerShell commands line interface For Ms DOS and UNIX OS It looks like . Of them separated 2 main ones that stand difference there is :
  • With the Microsoft .NET Framework very good is integrated . This is orders and to scripts strong software solutions find opportunity gives .
  • At the terminal returnable all values just rows not , maybe appeal to do possible was objects This is for you . extremely strong software scripts to create opportunity gives .

  • To PowerShell entrance for On Windows Start PowerShell �via​ by entering opens .
  • Win+R

12 of 18

3. PowerShell​ update

  • PowerShell commands on the line his/her version determination for following is entered :

Get-Host | Select-Object Version

  • Result

Version

-------

2.0

  • From PowerShell version 5.1 small If , then Windows PowerShell 5.1 and from it high version installation need will be .
  • PowerShell 5.1 's to the composition Download Windows Management Framework 5.1 from the Microsoft Download Center from download you can get possible .

13 of 18

14 of 18

2. PowerShell commands

  • PowerShell commands from the line Get-Help commandline pick it up , its reference system see possible .
  • The following command through current in the catalog folders list see possible :

it is

  • The following command it is with one kind :

ls

  • Get- ChildItem commandlet also gives us this the work having done gives .

ls Alias:\ - All aliases list with quickly acquaintance

15 of 18

4. Processes in PowerShell see

  • Procedures show :

get-process

  • " get-process" explorer ” from orders returnable of the object methods and properties list show :

get-process explorer | get-member

  • Open descriptions amounts growth according to processes list sort :

get-process | sort-object handles

  • working set size from 20 Mb big was processes show :

get-process | where-object { $_. get_WorkingSet () - gt 20M }

16 of 18

  • PowerShell scripts in to write very easy . ��Simple Example : Processes list take , process.txt to the file we will save and to the console issue ��PS> Get-Process | Tee-Object - filepath C:\ process.txt��

17 of 18

  • Remove-Item # One something take throw
  • Get -Help #any thing for help to take
  • Set-Alias # Create a
  • New- Item #New object create ( Object every how thing to be possible , for example , file )

Simple calculations done increase as follows :

18 of 18

Variables