Close
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
Read Down
Sign in
Close
Welcome!Log into your account
Forgot your password?
Read Down
Password recovery
Recover your password
Close
Search
Logo
Logo
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
More
    Home Latest News

      Command Line Makes Comeback

      Written by

      Jason Brooks
      Published January 29, 2007
      Share
      Facebook
      Twitter
      Linkedin

        eWEEK content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

        Once upon a time, when DOS walked the Earth, the command line was the primary user interface for most of our computers. Then, Windows came along, and Microsoft seemed set on leaving the command prompt to dry up and wither into obscurity. Fortunately, Microsoft has again turned its attention to the command line and, in so doing, has produced one of the most compelling new Windows features eWeek Labs has ever had the pleasure to test: Windows PowerShell.

        PowerShell 1.0, which was formerly known by the code name Monad, extends to administrators, developers and enthusiasts a powerful new interface for their Windows machines thats based on stringing together small, well-defined applications into pipelines—a handy capability on which Linux and Unix administrators have long relied.

        However, unlike Linux and Unix shells such as bash or korn, in which strung-together applications pass data to each other as raw text, PowerShell boasts an object-based approach that enables elements to communicate more intelligently with each other.

        For instance, in both the bash shell (the default for most Linux distributions) and in PowerShell, you can sort items in a folder by size by piping the output of a “list items” command to a “sort” command. With bash, however, the fact that piped commands pass their output as raw text means that you have to pay attention to text formatting on both ends of the pipeline. If you run the command “ls” without the “-l” argument, the command wont spit out file sizes, so “sort” wont be able to sort by file size. On the other end, “sort” needs to be told to sort by the fifth column from the left and to treat that column as numerical data.

        With PowerShell, the built-in command (or cmdlet, in PowerShell parlance) that corresponds to “ls” is an object, and “length” is one of its properties. When you pipe the output of this cmdlet (called Get-ChildItem) to the cmdlet Sort-Object, you can tell it how to sort by file length appending the word length. While it happens that file length is one of the properties that Get-ChildItem outputs by default, you can just as easily sort by other, hidden-by-default properties, such as LastAccessTime.

        One great thing about PowerShells object-based approach is that it reduces the need to learn application-specific arguments and quirks in favor of learning habits and syntax that apply to many different commands and operations. We also appreciated that Power-Shell ships with a large set of predefined aliases for its cmdlets that make the products learning curve less steep.

        Probably the best usability/

        discoverability attribute of PowerShell, however, is the Get-Member cmdlet, which fetches all the properties and methods available for a given object. We used Get-Member quite a bit while poking around PowerShell and figuring out what we could do with it. We expect that PowerShell will become a major productivity boon for Windows administrators as Microsoft expands the objects through which Power-Shell users may control Windows.

        In the meantime, we could use PowerShell cmdlets to manipulate services and proc-esses and to fetch WMI (Windows Management Instrumentation) data. We also could browse the system registry through an ingenious PowerShell capability that exposes registry hives as if they were disk drives, and we could use PowerShell to take control of Windows COM (Component Object Model) objects.

        As with other shells, Power–Shell is intended to serve as an environment for scripting, but, for security reasons, it is configured by default to be used only interactively, from its command line.

        PowerShell can be in–stalled using three execution policies: RemoteSigned runs unsigned local scripts and requires a digital signature for scripts marked as downloaded from the network, AllSigned requires a digital signature for any script, and Unrestricted runs scripts without digital signing restrictions. As a further safeguard, PowerShell scripts cannot be run by double-clicking on them.

        PowerShell, which de–pends on .Net Framework 2.0, is freely available for download at microsoft.com/powershell in versions for Windows XP SP2 and Windows Server 2003 (for the x86, x64 and Itanium platforms). At press time, PowerShell wasnt yet available for the RTM (released to manufacturing) version of Vista.

        We managed to install PowerShell on an RTM Vista box following directions we found at gaurhothw.spaces.live.com/blog/s!52B0837064D0B275!106.entry. We recommend, however, sticking to Windows XP or Windows Server 2003 for PowerShell testing until the Vista installer ships.

        Advanced Technologies Analyst Jason Brooks can be reached at jason_brooks@ziffdavis.com .

        Jason Brooks
        Jason Brooks
        As Editor in Chief of eWEEK Labs, Jason Brooks manages the Labs team and is responsible for eWEEK's print edition. Brooks joined eWEEK in 1999, and has covered wireless networking, office productivity suites, mobile devices, Windows, virtualization, and desktops and notebooks. Jason's coverage is currently focused on Linux and Unix operating systems, open-source software and licensing, cloud computing and Software as a Service.

        Get the Free Newsletter!

        Subscribe to Daily Tech Insider for top news, trends & analysis

        Get the Free Newsletter!

        Subscribe to Daily Tech Insider for top news, trends & analysis

        MOST POPULAR ARTICLES

        Artificial Intelligence

        9 Best AI 3D Generators You Need...

        Sam Rinko - June 25, 2024 0
        AI 3D Generators are powerful tools for many different industries. Discover the best AI 3D Generators, and learn which is best for your specific use case.
        Read more
        Cloud

        RingCentral Expands Its Collaboration Platform

        Zeus Kerravala - November 22, 2023 0
        RingCentral adds AI-enabled contact center and hybrid event products to its suite of collaboration services.
        Read more
        Artificial Intelligence

        8 Best AI Data Analytics Software &...

        Aminu Abdullahi - January 18, 2024 0
        Learn the top AI data analytics software to use. Compare AI data analytics solutions & features to make the best choice for your business.
        Read more
        Latest News

        Zeus Kerravala on Networking: Multicloud, 5G, and...

        James Maguire - December 16, 2022 0
        I spoke with Zeus Kerravala, industry analyst at ZK Research, about the rapid changes in enterprise networking, as tech advances and digital transformation prompt...
        Read more
        Video

        Datadog President Amit Agarwal on Trends in...

        James Maguire - November 11, 2022 0
        I spoke with Amit Agarwal, President of Datadog, about infrastructure observability, from current trends to key challenges to the future of this rapidly growing...
        Read more
        Logo

        eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site’s focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

        Facebook
        Linkedin
        RSS
        Twitter
        Youtube

        Advertisers

        Advertise with TechnologyAdvice on eWeek and our other IT-focused platforms.

        Advertise with Us

        Menu

        • About eWeek
        • Subscribe to our Newsletter
        • Latest News

        Our Brands

        • Privacy Policy
        • Terms
        • About
        • Contact
        • Advertise
        • Sitemap
        • California – Do Not Sell My Information

        Property of TechnologyAdvice.
        © 2024 TechnologyAdvice. All Rights Reserved

        Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

        ×