使用powershell(无gui)如何找出我正在使用的Windows PowerShell的AWS Tools版本?
更多:
我正在使用PowerShell的PowerShell远程处理和AWS工具从S3下载文件。 我在设置凭据时遇到了麻烦, 这个powershell参考指出:
在Windows PowerShell工具的版本低于1.1的版本中,Set-AWSCredentials命令无法正常工作
但是我不知道我使用的是什么版本的AWS工具。 似乎没有明显的命令来尝试,例如,Read-S3Object命令-Version参数用于确定正在下载的S3对象的版本,而不是AWS工具的版本。
我可以通过使用RDP和添加/删除程序gui来解决这个问题,但这是一个不同的问题,这个服务器只能用于远程pipe理。
您可以通过Get-Module检查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....
为了将来的参考,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]
文档: