DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Languages
  4. PowerShell for Developers

PowerShell for Developers

John Cook user avatar by
John Cook
·
Aug. 23, 12 · Interview
Like (0)
Save
Tweet
Share
6.04K Views

Join the DZone community and get the full member experience.

Join For Free

powershell was written first and foremost for windows system administrators, and the benefits to this community are clear. it’s not as clear what developers should make of powershell.

administrators can learn powershell as a shell first , and gradually transition from interactive use to scripting. they may learn powershell as their first programming language and not even give too much thought to the language per se. but a developer has to ask why and when to use powershell rather than another language, such as c#.

doug finke’s new book windows powershell for developers is “for developers” in a couple ways. first, the style of the book is geared toward developers. the book is small, less than 200 pages, because the author assumes the readers are experienced windows developers who want to focus on what powershell adds to what they already know. second, the book focuses on tasks a developer might want to do. rather than show you how to create a new active directory user, as many powershell books would, this book covers topics such as

  • code generation
  • static analysis
  • interfacing with c#
  • embedding powershell in your application
  • working with xml and json
  • interfacing with excel
  • creating dsls.

so why should software developers use powershell? and what tasks should they do in powershell? one answer to the first question, implicit in the book’s examples, is that powershell makes it possible to carry out common tasks with little code. another answer explicitly given in the book is integration.

given powershell’s growing integration with the rest of the windows platform, as powershell grows, so does your application .”

the book is full of examples of what tasks a developer might want to do in powershell. the examples i found most interesting were embedding powershell to provide a scripting language for your application and creating dsls in powershell.

one pattern in the examples is text munging, whether that text is source code or common data file formats. another pattern is integration, especially integrating microsoft technologies. powershell is designed to make it possible to solve these kinds of problems with a minimum of ceremony.

i’ll close with a couple reasons why might a developer not want to use powershell in my opinion. the first is frequency of use. although powershell can solve many problems with significantly less code than c# would require, you have to learn powershell first, and you have to use it frequently enough to remember it. you have to use powershell enough to repay the time invested in learning and practicing it.

the second reason is size. the c# language and the visual studio ide were designed for large projects, but scale down fairly well for smaller projects. powershell was designed for the command line, but scales fairly well for large scripts. if you use powershell and c#, you’ll have to decide at what size you want to switch from one language to the other.

PowerShell dev

Published at DZone with permission of John Cook, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Core Machine Learning Metrics
  • The 31 Flavors of Data Lineage and Why Vanilla Doesn’t Cut It
  • Do Not Forget About Testing!
  • Apache Kafka vs. Memphis.dev

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: