powershell icon indicating copy to clipboard operation
powershell copied to clipboard

Documentation: Using pnp/powershell Docker Image

Open shurick81 opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe. Starting using pnp/powershell Docker Image might be tricky for beginners

Describe the solution you'd like An article, similar to https://pnp.github.io/powershell/articles/azurecloudshell.html, that presents different options and different examples of using the module in Docker.

Describe alternatives you've considered Alternative could be experimenting and learning individually

Additional context

shurick81 avatar Jun 18 '22 20:06 shurick81

Would you mind creating such an article yourself in a PR @shurick81? I think it would be very valuable.

KoenZomers avatar Jun 20 '22 06:06 KoenZomers

I have prepared some draft here: https://github.com/shurick81/pnp.powershell/blob/feature/docker-docu/pages/articles/docker.md

Could someone look into instructions for Mac OS and test them? I don't have access to any MacBook at the moment.

shurick81 avatar Jul 13 '22 21:07 shurick81

@veronicageek Can you assist here?

KoenZomers avatar Jul 13 '22 22:07 KoenZomers

Yep, will have a look as soon as I can.

veronicageek avatar Jul 13 '22 22:07 veronicageek

@veronicageek - any update on this ? Would be great to have this in our docs 😊

gautamdsheth avatar Aug 25 '22 13:08 gautamdsheth

@gautamdsheth - Nope, too busy with work and on annual leave for 3 weeks at the end of next week.

veronicageek avatar Aug 25 '22 13:08 veronicageek

Could someone send me a spare Mac maybe? :)

shurick81 avatar Aug 25 '22 13:08 shurick81

@shurick81 - I'll go thru your instructions over the weekend.

veronicageek avatar Sep 27 '22 20:09 veronicageek

@shurick81 - The first 2 cmds worked fine:

  • brew install --cask docker
  • docker run --rm -it m365pnp/powershell

But when running docker run --rm -it -v $(pwd):/home -w /home m365pnp/powershell, I've got the following error: docker: invalid reference format.

When I run docker run --help, I just got a list of the possible commands. Also note I'm not really experienced in Docker, so maybe I'm missing something.

veronicageek avatar Oct 02 '22 13:10 veronicageek

Thanks for running the test @veronicageek!

After you get this error, could you check what this command outputs?

echo $(pwd)

Might it be the case that the path you are in contains spaces, like "/home/my best folder/etc"? Then I think I know the solution :)

shurick81 avatar Oct 04 '22 11:10 shurick81

@waldekmastykarz do you have any ideas?

shurick81 avatar Oct 04 '22 11:10 shurick81

Not off the top of my head, no :(

waldekmastykarz avatar Oct 05 '22 08:10 waldekmastykarz

@shurick81 - hmm, in that case, can we please modify the article and specify that the instructions are for windows machines? We can later modify the article once we are able to get it working for Mac somehow? Same with all your other enhancement requests?

This way, at least we have something for Windows users.

gautamdsheth avatar Oct 07 '22 18:10 gautamdsheth

Thanks for running the test @veronicageek!

After you get this error, could you check what this command outputs?

echo $(pwd)

Might it be the case that the path you are in contains spaces, like "/home/my best folder/etc"? Then I think I know the solution :)

@shurick81 - I've run the command but my path doesn't contain spaces. However, there's the /Users which starts in uppercase. I think I had an issue before where it was complaining that the path should be lowercase only (?).

veronicageek avatar Oct 08 '22 15:10 veronicageek

@shurick81 - hmm, in that case, can we please modify the article and specify that the instructions are for windows machines? We can later modify the article once we are able to get it working for Mac somehow? Same with all your other enhancement requests?

This way, at least we have something for Windows users.

Yes, that might be a way to go

shurick81 avatar Oct 08 '22 16:10 shurick81

@veronicageek

Could you also try

docker run --rm -it -v "$(pwd):/home" -w /home m365pnp/powershell

shurick81 avatar Oct 08 '22 17:10 shurick81

@shurick81 - Yes, adding the double quotes seems to have worked.

image

Also in your guide, the Get-ChildItems is Get-ChildItem (no plural) 🙂

veronicageek avatar Oct 09 '22 14:10 veronicageek

Great, I updated the documentation, should I create a PR or someone needs to test more?

shurick81 avatar Oct 09 '22 20:10 shurick81

Closing this now, thanks @shurick81 for adding the docs !

gautamdsheth avatar Oct 25 '22 18:10 gautamdsheth