Windows PowerShell

advertisement
Microsoft Windows PowerShell
/w EPDw UKMTAy
Windows PowerShell is a programming language like other programming languages. The
PowerShell language is similar to Perl. This is important that the PowerShell is an objectoriented language and interactive command line shell for Microsoft Windows Platforms. We
can control all features of widows such as navigate through drives, folders; creating and
removing files and folders; modifying contents, and change the behavior of Windows.
Features of PowerShell
One of the great features of PowerShell is the integration with the Microsoft .Net
environment & also can be implanted within other applications. Microsoft Windows
PowerShell was specially designed to automate system task and create system management
tools for commonly implemented processes.
The Microsoft Windows PowerShell provides a number of ways to automate jobs, including:




Cmdlets, which are very small .NET classes that appear as system
commands.
Scripts, which are combinations of cmdlets and associated logic.
Executables, which are standalone tools.
Instantiation of standard .NET classes.
Common uses of PowerShell
As we know PowerShell is an object-oriented language & allow using Microsoft .Net library,
So we can use the PowerShell script in quite a lot of ways; some of the common uses are
listed below:









Windows Active Directory.
Document management / File processing.
Network monitor.
Working with Xml.
Working with Microsoft Office system.
Working with Microsoft SQL server.
Working with Microsoft SharePoint.
Working with Microsoft Exchange Server.
Etc.
How to open PowerShell
1. START→ALL PROGRAMS→ACCESSORIES→WINDOWS
POWERSHELL→POWERSHELL
2. START→RUN→POWERSHELL
Some Common Cmdlets which we will cover are:
1. Get-help get
2. Get-help set
3. Get-help new
4. Get-date
5. Get-date -displayhint time
6. Get-help –displayhint date
7. Get-help set-date -examples
8. Get-location
9. Get-help get-location –full [switch]
10. Clear-host OR clear OR cls
11. Get-childitem [alias] dir
12. Set-location [alias] cd
13. Set-location .. [alias] cd..
14. Set-location “My folder”
15. Set-location hklm:
16. New-item –name Abdullah/“[Abdullah & Ali]” –type [file/folder]
17. New-item –name “practice.docx” –type file
18. Md “new folder”
19. New-item “my file” –type file
20. Edit “my file”
21. Get-service
22. Edit practice.txt
23. Edit practice.docx
24. Type practice.docx
25. Copy practice.docx e:\
26. Copy-item practice.docx c:\documents
27. Rename-item “my file” “my new file”
28. Ren “my file” “my new file”
29. Move-item “my new file” e:\
30. Move ali1 c:\
31. Remove-item ali.docx
32. Rd “new folder”
33. Get-help get/set/new/rename/copy | out-file “Help.txt”
34. Ipconfig
35. Get-host
36. Get-random
37. Get-history
38. Get-culture
39. Get-PSDrive
40. Get-hotfix
41. Get-itemProperty
42. New-alias gh get-help
43. 1+1
44. $a/$b
45. $c=$a+$b {variable declaration}
46. $name = “Abdullah”
47. $name
48. get-childitem | format-list –property *
49. Get-alias
50. Exit
Download