How does the command Remove-RoleMember works ?
I tried using
Remove-RoleMember -Identity "developer" -Member "XYZ"
(sitecore\XYZ role is added as member of sitecore\developer role with the Add-RoleMember command, which worked correctly)
There are no errors when I executed this command. However, the role is not removed from the Developer role. The command works if you pass a sitecore user as an argument in the -Member argument.
I have Sitecore 8.1 and v4.0 Powershell extensions installed. Am I doing anything wrong here ?
Please try with : Remove-RoleMember -Identity developer -Members "XYZ"
Looks like you wrote "developer" and not developer and you wrote -Member and not -Members
Please also check description of this command here
Related
Sorry if this is a dumb question - I'm just getting started with AWS - I've installed the AWS CLI utility on Windows, and configured it with my access key and secret. The command "aws --version" says "aws-cli/2.8.10 Python/3.9.11 Windows/10 exe/AMD64 prompt/off". I'm trying to run "aws assume-impersonation-role" as documented here:
https://docs.aws.amazon.com/cli/latest/reference/workmail/assume-impersonation-role.html
but I get the error "invalid choice". The list of valid choices has nothing like what I'm looking for. Is there some extension or add-on I need to install?
Just to check the obvious, are you doing:
aws assume-impersonation-role --organization-id … --impersonation-role-id …
rather than the intended
aws workmail assume-impersonation-role --organization-id … --impersonation-role-id …
?
I am trying to create a new AWS Serverless Application on Pycharm but i am getting this error:
Could not execute `sam init`!: [Cloning from https://github.com/aws/aws-sam-cli-app-templates (process may take a moment),
Error: Unstable state when updating repo. Check that you have permissions to create/delete files
How can i solve this problem ?
Details:
OS:Windows 10 , x64
Version: Python 3.9, SAM CLI- 1.53.0
IDE: Pycharm 2022.1.3 Pro Edition
Git Version 2.37
Open PowerShell in admin mode and type this and execute
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
worked for me. (fixes webstorm aws toolkit error in init too)
Okay here is the problem why it occurs and the solution for Windows users:
The problem was with the path ("AWS SAM") in Windows that has a space causes the problem:
By calling the --location arg and puting the full path in double quotes it works
sam init --location "C:\Users[your_user_name]\AppData\Roaming\AWS
SAM\aws-sam-cli-app-templates\python3.9\cookiecutter-aws-sam-hello-python"
Ref: https://github.com/aws/aws-sam-cli/issues/1891
Thanks to:
https://github.com/hawflau
https://github.com/john-zenden
On my windows machine, I fixed it by setting LongPathsEnabled to 1 in the registery:
Open Registry Editor (regedit.exe).
Navigate to
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Set LongPathsEnabled to 1.
This sets Git to allow long paths
Neither of the solutions worked for me. Instead:
Open Registry Editor (regedit.exe).
Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Set LongPathsEnabled to 1
Copied from: https://lightrun.com/answers/aws-aws-sam-cli-permissions-error-unstable-state-when-updating-repo
Run this in powershell (as admin)
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
works for me
I am trying to athenticate to the gcloud sdk using : gcloud init.
I get a URL I'm supposed to access in order to copy a token and return it to the CLI... but instead of a token, I get this error :
Erreur d'autorisation
Erreur 400 : invalid_request
Missing required parameter: redirect_uri
Is this a bug?
gcloud version info:
Google Cloud SDK 377.0.0
alpha 2022.03.10
beta 2022.03.10
bq 2.0.74
bundled-python3-unix 3.8.11
core 2022.03.10
gsutil 5.8
I am running gcloud init on wsl2 (Ubuntu 18.04). This error occurs right after the installation of gcloud with sudo apt install google-cloud-sdk.
I had the same problem and gcloud has slightly changed the way their auth flow works.
Run gcloud auth login and then copy the whole output (not just the URL) to a terminal on a computer that has both a web browser and gcloud CLI installed. The command you should copy looks like
gcloud auth login --remote-bootstrap="https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=****.apps.googleusercontent.com&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=****&access_type=offline&code_challenge=****&code_challenge_method=S256&token_usage=remote"
When you run that on your computer that has a web browser, it will open a browser window and prompt you to log in. Once you authorize your app in the web browser you get a new URL in your terminal that looks like
https://localhost:8085/?state=****&code=****&scope=email%20openid%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/cloud-platform%20https://www.googleapis.com/auth/appengine.admin%20https://www.googleapis.com/auth/compute%20https://www.googleapis.com/auth/accounts.reauth&authuser=0&hd=****&prompt=consent
Paste this new URL back into the prompt in your headless machine after Enter the output of the above command: (in your case, this would be in your WSL2 terminal). Press enter and you get the output
You are now logged in as [****].
Your current project is [None]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
[8]+ Done code_challenge_method=S256
Try
gcloud init --console-only
Then you will get the url which will work.
You must log in to continue. Would you like to log in (Y/n)? y
WARNING: The --[no-]launch-browser flags are deprecated and will be removed on June 7th 2022 (Release 389.0.0). Use --no-browser to replace --no-launch-browser.
Go to the following link in your browser:
https://accounts.google.com/o/o....
update 2022-06-20. option console-only is removed for version 389.0.0.
So instead use
gcloud init --no-browser
There are some workarounds and they depend on your particular Windows environment.
In this post and in this one you can check the most related issues with respect to gcloud running in WSL.
Here you can find some Google groups related threads that might be helpful.
Finally, you could check some related Windows troubleshootings that can help in issues related to WSL2 on your own environment.
EDIT:
it seems this answer and the one from #K.I. give other commands that don't rely on implementation details. I've tested those 3 commands:
gcloud init --console-only
gcloud auth login --no-launch-browser
gcloud init --no-launch-browser
Original answer, another workaround (17/07/2022):
DISPLAY=":0" gcloud auth login
is a workaround mentioned in this issue. Instead of requiring you to install gcloud CLI outside WSL2, it pretends there is a browser.
A link is printed, click it, login on your browser, and you're authenticated with the CLI.
Then run again gcloud init.
You can do it without error by using another method of gcloud installation :
curl https://sdk.cloud.google.com | bash
exec -l $SHELL #restart shell
gcloud init
I have multiple profiles in my aws config file. Instead of adding --profile in each command, I want to set the profile to a particular profile before executing the commands. I tried using "set AWS_PROFILE profilename". It's working when I open new powershell prompt but I want in the same prompt. Sometimes it's not working even in new prompt.
Setting AWS_PROFILE doesn't do anything at all for me. (Looks like there's an issue open for it.)
You can achieve the same result with Set-AWSCredential -ProfileName [...] though. If you've already set the environment variable you can just do:
Set-AWSCredential -ProfileName $env:AWS_PROFILE
I installed Excelsior Jet11 and trying to use it. I downloaded it from their official site. I also exported the paths also with the followings.
export PATH=JET-home/bin:$PATH
export LD_LIBRARY_PATH=\
JET-home/lib/x86/shared:$LD_LIBRARY_PATH
I specified the with the directory of jet. I also activated the profile that is supported by jet. But while i'm trying to launch JET with this: ../../opt/jet11/profile1.8.0_40/jre/bin/java
returned a message like following image without launching the JET.
I'm not getting any solution now to launch it.
You are supposed to launch your app with that:
../../opt/jet11/profile1.8.0_40/jre/bin/java -jar MyApp.jar
Alternatively, type
jetcp
to bring up the Excelsior JET Control Panel.