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

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

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

更多的:

我正在使用 powershell remoting 和适用于 Windows PowerShell 的 AWS 工具从 S3 下载文件。我在设置凭证时遇到问题,此 aws powershell 参考指出:

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

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

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

答案1

您可以通过以下方式检查模块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....

答案2

供将来参考,AWS Tools for PowerShell 本身有一个 cmdlet 来获取 cmdlet 版本,Get-AWSPowerShellVersion。这将返回已安装模块和已安装 .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]

文档:

相关内容