仅使用 powershell 确定 AWS 工具的版本

And*_*w M 5 powershell amazon-web-services

使用 powershell(无 gui)如何找出我正在使用的适用于 Windows PowerShell 的 AWS 工具版本?

更多的:

我正在使用 powershell 远程处理和适用于 Windows PowerShell 的 AWS 工具从 S3 下载文件。我在设置凭据时遇到问题,这个 aws powershell 参考指出:

在早于 1.1 的 Windows PowerShell 工具版本中,Set-AWSCredentials 命令无法正常工作

但我不知道我使用的是哪个版本的 AWS 工具。似乎没有明显的命令可以尝试,例如,Read-S3Object 命令 -Version 参数用于确定正在下载的 S3 对象的版本,而不是 AWS 工具的版本。

我可能可以通过使用 RDP 和添加/删除程序 gui 来解决这个问题,但这是一个不同的问题,该服务器应该仅使用 powershell 远程处理进行管理。

jsc*_*ott 6

您可以通过Get-Module.

Get-Module -ListAvailable -Name AWSPowerShell

    Directory: C:\Program Files (x86)\AWS Tools\PowerShell

  ModuleType Version    Name            ExportedCommands
  ---------- -------    ----            ----------------
  Binary     3.1.75.0   AWSPowerShell   {Clear-AWSHistory, Set-AWSHistoryConfiguration....
Run Code Online (Sandbox Code Playgroud)


Ant*_*ace 5

为了供将来参考,AWS Tools for PowerShell 本身有一个用于获取 cmdlet 版本 Get-AWSPowerShellVersion 的 cmdlet。这将返回已安装模块和已安装 .NET SDK 的版本。

例子:

PS C:/> Get-AWSPowerShellVersion

AWS Tools for Windows PowerShell
Version 3.1.95.0
Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Amazon Web Services SDK for .NET
Core Runtime Version 3.1.10.0
Copyright 2009-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Release notes: https://aws.amazon.com/releasenotes/PowerShell

This software includes third party software subject to the following copyrights:
- Logging from log4net, Apache License
[http://logging.apache.org/log4net/license.html]
Run Code Online (Sandbox Code Playgroud)

文档: