Powershell

Table of Contents


AWS


What Is the AWS Command Line Interface?



Read more about AWS Command Line Interface here https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html

The AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your favorite terminal program:



The AWS CLI is available in two versions and information in this guide applies to both versions unless stated otherwise.



All IaaS (infrastructure as a service) AWS administration, management, and access functions in the AWS Management Console are available in the AWS API and CLI. New AWS IaaS features and services provide full AWS Management Console functionality through the API and CLI at launch or within 180 days of launch.

The AWS CLI provides direct access to the public APIs of AWS services. You can explore a service's capabilities with the AWS CLI, and develop shell scripts to manage your resources. Or, you can take what you learn to develop programs in other languages by using the AWS SDKs. In addition to the low-level, API-equivalent commands, several AWS services provide customizations for the AWS CLI. Customizations can include higher-level commands that simplify using a service with a complex API.

To install AWS CLI follow the following documentation - https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html This is needed as PowerShell for AWS doesn't have all native commands that AWS currently uses, hence the AWS CLI (Currently Version 2) library of Windows CLI commands will increase the library of functions to use in PowerShell on top of the AWS for PowerShell commands.



What Are the AWS Tools for PowerShell?



Read more about AWS Command Line Interface here https://docs.aws.amazon.com/powershell/latest/userguide/pstools-welcome.html

The AWS Tools for PowerShell are a set of PowerShell modules that are built on the functionality exposed by the AWS SDK for .NET. The AWS Tools for PowerShell enable you to script operations on your AWS resources from the PowerShell command line.

The cmdlets provide an idiomatic PowerShell experience for specifying parameters and handling results even though they are implemented using the various AWS service HTTP query APIs. For example, the cmdlets for the AWS Tools for PowerShell support PowerShell pipelining—that is, you can pipe PowerShell objects in and out of the cmdlets.

The AWS Tools for PowerShell are flexible in how they enable you to handle credentials, including support for the AWS Identity and Access Management (IAM) infrastructure. You can use the tools with IAM user credentials, temporary security tokens, and IAM roles.

The AWS Tools for PowerShell support the same set of services and AWS Regions that are supported by the SDK. You can install the AWS Tools for PowerShell on computers running Windows, Linux, or macOS operating systems.



Note

AWS Tools for PowerShell version 4 is the latest major release, and is a backward-compatible update to AWS Tools for PowerShell version 3.3. It adds significant improvements while maintaining existing cmdlet behavior. Your existing scripts should continue to work after upgrading to the new version, but we do recommend that you test them thoroughly before upgrading. For more information about the changes in version 4, see Migrating from AWS Tools for PowerShell Version 3.3 to Version 4.

The AWS Tools for PowerShell are available as the following three distinct packages:





AWSPowerShell - A Single-Module Version for Windows PowerShell



Be aware this is a large module to install.

This version of AWS Tools for PowerShell is compatible with and installable on only Windows computers that are running Windows PowerShell versions 2.0 through 5.1. It is not compatible with PowerShell Core 6.0 or later, or any other operating system (Linux or macOS). This version consists of a single, large module that contains support for all AWS services.

Throughout this guide, when we need to specify this version only, we refer to it by its module name: AWSPowerShell.

1) To get started simply install the AWS Module onto your device by running this command - Install-Module -Name AWSPowerShell.NetCore
If the module cannot be found from the online PowerShell module library repository then download and install the package manually from this link - https://www.powershellgallery.com/packages/AWSPowerShell.NetCore/4.0.6.0

2) Then import the modules into your PowerShell session import-module -Name AWSPowerShell.NetCore

3) Create AWS Access key and store securely - https://console.aws.amazon.com/iam/home?#/security_credentials

4) Run PowerShell command Initialize-AWSDefaults And enter AWS Access keu and AWS Secret Key



5) Done. You can test the PowerShell for AWS modules are available by running the help ec2instance command to bring up all the AWS for PowerShell commands. Alternatively you can run get-command against the AWSPowerShell.NetCore module to find all relevant PowerShell commands