This topic contains 6 replies, has 6 voices, and was last updated by
June 18, 2019 at 9:30 am #161666ParticipantTopics: 3Replies: 5Points: 44Rank: Member
As a very small team we have been thrown in at the deep end and been told to start learning and using Powershell. We are a small team of Business Intelligence Developers and none of us have any experience with Powershell and what can be done with it. We have been given a small task to learn from scratch the Powershell product. Our first test project is as follows:
As a developer,
I want the restore of the HealthBI database to be automated
So that I can focus on other tasks without having to monitor it
- Given that a backup of the HealthBI database is available,
When I trigger the initialisation/restoration process,
Then the HealthBI database is restored
And the DA Loaders have been regenerated
And the DA Exports have been regenerated
And the DA Orchestrations have been regenerated
And the config has been updated to the test server config
And the security model has been updated to the test server model
And the most recent version of reference data files has been applied
And the correct Product Licences have been applied
And a log file is created, detailing the outcome of each stage of the script
Obviously I don't need the work doing but would love if there were some pointers of what to learn to accomplish the above, so I can get stuck in and start to learn Powershell. So far I have covered the 2 beginners courses on Pluralsight (Powershell: Getting Started and Your First Day with Powershell). It does seem daunting to be honest and much of it went over my head, however I felt the same learning T-Sql and that's now part and parcel of my working life so not put off by the challenge.
I welcome ALL advice and will try to take as much on board as humanly possible.
- Given that a backup of the HealthBI database is available,
June 18, 2019 at 1:36 pm #161715ParticipantTopics: 12Replies: 232Points: 466Rank: Contributor
In general for beginners, most recommend the book:
"Learn Windows PowerShell in a Month of Lunches 3rd Edition" by Don Jones and Jeffrey Hicks.
But any of the courses or books are going to be generic compared to your specific tasks.
So you'll also need to investigate how those tasks are going to be done in the products you use.
E.g. using command lines, API's etc.
June 18, 2019 at 2:36 pm #161739ParticipantTopics: 25Replies: 678Points: 1,629Rank: Community Hero
Go straight to the source, man: Payette – Windows Powershell in Action
June 18, 2019 at 3:27 pm #161754ParticipantTopics: 2Replies: 999Points: 1,946Rank: Community Hero
PowerShell efforts, can be just like any other development effort. So, many of the same rules apply.
Begin by using PowerSHell as your default vs cmd.exe / DOS.
Anytime you find yourself thinking DOS stuff first, stop, and figure out how to do it in PowerShell.
PowerShell is an object oriented language, and relies on .Net and .Net Core on OSX / Linux. It's commands are longer than what you would do in DOS. There are shorthand / aliases that can be used, but beer sure to limit your use of those interactive stuff.
In scripts, always, always use the full cmdlet/function names, parameter name and switch names. It's keeps the code self-documenting, easier to read, share and maintain.
Lastly, never ever, run any code from any one from anywhere, that you do not fully understand and what it is / will do. If you do, you could seriously damage your host and or your enterprise. Learn to master the -WhatIf, -Confirm, and leveraging the Set-StrictMode are part of your development, put that in your profile. Learn about profiles, and how to use them. Learn about execution policies, what they are and how / when to use them. Fully leverage auditing, monitoring and logging of PowerShell use by all users and processes. Especially as part of your corporate risk management effort.
Work on code style, sharing and use standardization.
Book references, normally the ones you'll see most recommend:
Learn Windows PowerShell in a Month of Lunches 3rd Edition
Donald W. Jones (Author), Jeffrey Hicks (Author)
Windows PowerShell Cookbook: The Complete Guide to Scripting Microsoft's Command Shell 3rd Edition
Lee Holmes (Author)
Windows PowerShell in Action 3rd Edition
by Bruce Payette (Author), Richard Siddaway (Author)
Windows PowerShell Survival Guide
Purpose of this Document
The purpose of this document is to help you to learn more about PowerShell and to be successful in applying it. This document seeks to point to the best content on the web to enable you to reach that goal.
Scope of this Document
This page contains links to help you learn more about Microsoft Windows PowerShell. This includes PowerShell fundamentals as well as how PowerShell is used in Windows applications and services. As long as it's PowerShell related, we'll try to point to it! The document is also version agnostic, and contains information about current and future versions of PowerShell.
See also posts here for other resource suggestions here:
Learning this stuff.Comment from discussion get-postanote's comment from discussion "Learn Powershell".Comment from discussion get-postanote's comment from discussion "Learn Powershell".
Practice with PSKoans
PSKoans : 0.50.0
A module designed to provide a crash-course introduction to PowerShell with programming koans.
Come to know your dev tools / environments:
Built into Windows PowerShell ISE (though no more work is going into it, Micros has already said, it will always be in the OS).
Visual Studio Code, then new hotness, for developers, and scripters. It takes a while to get it configure for all you will need, and provides far more that the ISE does.
Sapien's PowerShell studio is the first class / top tier full IDE for PowerShell, but it not a inexpensive one, but well worth the price IMHO.
Learn to use both, as in most cases, data center servers will not have VSCode, but the ISE is in the box.
There are a bunch of add-one / extensions for both.
Then of course you can use full Visual Studio for PowerShell script, GUI, module development. As you can with VSCode, just be sure to purchase the full PowerShell Pro Tools addon for PowerShell project. It's $59.00, so, in expensive, though to continue to get updates for it, that is an annual cost.
June 19, 2019 at 6:36 am #161909ParticipantTopics: 3Replies: 5Points: 44Rank: Member
Thanks all there is a wealth of information here which I will try to make good use of.
June 19, 2019 at 6:57 pm #162065ParticipantTopics: 8Replies: 31Points: 116Rank: Participant
I also started with the Month of Lunches books. Fantastic place to get started.
July 11, 2019 at 4:10 pm #165376ParticipantTopics: 4Replies: 10Points: 75Rank: Member
For beginning I usually point everyone to Jeffery Hicks list https://jdhitsolutions.com/blog/essential-powershell-resources/
You must be logged in to reply to this topic.