New Training: Real-World Automation with PowerShell 7
In this 6-video skill, CBT Nuggets trainer Knox Hutchinson teaches you how to automate real-world tasks by using PowerShell, such as file transfers, storing API data in SQL Server, and creating a database. Watch this new Microsoft Windows Server training.
Watch the full course: Programming Foundations with PowerShell 7
This training includes:
- 6 videos
- 25 minutes of training
You’ll learn these topics in this skill:
- Automating Daily Tasks
- Scenario 1: Daily File Transfers
- Downloading a File to a Historical Folder
- Scenario 2: Getting API Data Into SQL
- Creating the Pokemon Database
- Summarizing Real-World Automation
Why PowerShell is Better with Data Transfers than Other Shells
One of the most powerful features of a shell environment is piping. Piping is the ability to take data from one application and use it with another application. All shell environments have this ability, but PowerShell can take it a step further.
Let's say that you need to get information from an API and store it. With PowerShell, you can make a request to an API with something like a CURL request, retrieve that data, and then pipe it into a database.
PowerShell is in a unique position to be able to perform this kind of function compared to other shell environments, though. That's because of the way that PowerShell treats data. PowerShell is capable of handling data as objects as where other shells, like Bash, treat data as strings.
This is crucial for calling an API to retrieve data. It's standard for APIs to return data in a form of JSON. Because PowerShell can read that data as an object, it doesn't need any extra utilities to parse it. Instead, it can organize it and store that data in a database without a lot of extra work. This can also ensure the integrity of data as well.