-2

I am trying to set up my AWS on my local machine through windows PowerShell, it gives me the following error message;

Set-AWSCredentials -AccessKey = XXXXXXXXXXXXXX -SecretKey = AAAAAAAAAAAAAAAAAAAAAAAAAAAA -StoreAs testuser

Set-AWSCredentials : A positional parameter cannot be found that accepts argument
'AAAAAAAAAAAAAAAAAAAAAAAAAAAA'.
At line:1 char:1
+ Set-AWSCredentials -AccessKey = XXXXXXXXXXXXXX -SecretKey = AAAAAAAAAAA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-AWSCredentials], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Amazon.PowerShell.Common.SetCredentialsCmdlet

Please help:

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134

1 Answers1

0

The equals sign is not required for a parameter.

From Get-Help About_Parameters :-

Most Windows PowerShell commands, such as cmdlets, functions, and scripts, rely on parameters to allow users to select options or provide input. The parameters follow the command name and have the following form:

-<parameter_name> <parameter_value>

You are likely confusing setting a parameter with a variables, you would use the equals sign when assigning something to a variable:

$path = "C:\Windows\System32"
henrycarteruk
  • 12,708
  • 2
  • 36
  • 40