Why PowerShell is powerful

Source: Internet
Author: User

The Windows operating system and Office Office software were so excellent that Microsoft was not named Poweros and Poweroffice, but in the second year after the release of Monad (the predecessor of PowerShell) (2006), Microsoft has just released Windows PowerShell 1.0, and "shamelessly" named PowerShell, which is a bit too uncomfortable.

Today I have a little summary of why PowerShell is so powerful, based on my experience.

An unprecedented convenience

such as GB,MB,KB units in the storage calculation; 1 in the array declaration: N and subscript is the processing of-1, as well as some WYSIWYG, easy-to-understand verb + noun structure cmdlet.

Object oriented

Compared to the process, the object-oriented more convenient and easier to describe the real world, but also to catch up with the fashionable.

Tied up. NET this big tree

The so-called tree under the good shade, PowerShell tied to the. NET this rich, with the. NET Framework platform a powerful class library, almost everything is possible.

Powerful compatibility

Fully compatible with other calls on the Windows platform, such as executable files (EXE), batch bat, and VB script.

Platform-based scalability

Microsoft has the advantage that it prefers to be a platform when compared to applications. PowerShell has already become a platform, and in the second year of PowerShell's release, Microsoft's system Center Operations Manager and SharePoint provided components for that platform, later Active Directory, Hyper-V, Let alone the Windows azure,office 365. In addition to Microsoft, Amazon's Cloud platform management, Dell's Out-of-hand management, also provides PowerShell-based management components. PowerShell has become a standard, becoming a norm.

Example Introduction

If you've heard of PowerShell for the first time, want to look at it a little bit and see the 10 examples below.

    1. [Mathematical calculation] (39+79-51) *497/28 =?
      If you do it fast, you should not hit the ENTER key quickly:

      12 PS> (39+79-51)*497/281189.25
    2. [Date] How many minutes from the next Valentine's Day?
      I know how many days to calculate the distance, if it becomes a minute?

      12345678 $now=Get-Date$day=[datetime]‘2-14‘if($now -lt $day ){ $day.Subtract($now).TotalMinutes}else{ $day.AddYears(1).Subtract($now).TotalMinutes}
    3. [Capacity] 3GB > 3145726KB?
      12 PS> 3gb -gt3145726kbTrue
    4. can [ID] produce a GUID?
      12345 PS> [guid]::NewGuid()Guid----0f283ab4-f402-400c-98ce-359442f11f1a
    5. File What is the size of all executable exe files in the Windows directory?
      1 dir $env:windir-Filter *.exe | measure -SumLength
    6. [Registry]  Registry Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\. What is the value of netframework under   ' Enable64bit '?
      1 ( get-itemproperty -path hklm:software\microsoft\. NETFramework). Enable64bit
    7. is the [certificate] thumbprint of [28de15612aff1cd69596ab17af06ae86cb9c003b] Certificate in the certificate store?
      12 ls Cert:\LocalMachine\My\ | where { $_.Thumbprint -eq‘28DE15612AFF1CD69596AB17AF06AE86CB9C003B‘}
    8. Does the [Service] printer service start?
      1 Get-Servicespooler
    9. How many IE processes are currently running on [process]?
      1 (Get-Processiexplore ).count
    10. [Report] Exports all running process information as an HTML report?
      1 Get-ProcessConvertTo-Html Out-Filea.html

Why PowerShell is powerful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.