Skip to content

Commit 14cdda0

Browse files
author
Klaus Frank
authored
Mention PowerShell Repository
Added a section about the PowerShell Gallery and how to pull and update PowerShell Modules from there.
1 parent c7d1436 commit 14cdda0

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

book/A-git-in-other-environments/sections/powershell.asc

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,33 @@ It looks like this:
1010
.Powershell with Posh-git.
1111
image::images/posh-git.png[Powershell with Posh-git.]
1212

13-
Just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowershell` directory.
14-
Then open a Powershell prompt as the administrator, and do this:
13+
==== Installation
14+
===== Prerequisites
15+
Before you're able to run PowerShell scripts on your machine, you need to set your local ExecutionPolicy to RemoteSigned (Basically anything except Undefined and Restricted). If you choose AllSigned instead of RemoteSigned, also local scripts (your own) need to be digitally signed in order to be executed. With RemoteSigned, only Scripts having the "ZoneIdentifier" set to Internet (were downloaded from the web) need to be signed, others not.
16+
If you're an administrator and want to set it for all Users on that machine, use "-Scope LocalMachine".
17+
If you're a normal user, without administrative rights, you can use "-Scope CurrentUser" to set it only for you.
18+
More about PowerShell Scopes: (https://technet.microsoft.com/de-de/library/hh847849.aspx[])
19+
More about PowerShell ExecutionPolicy: (https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy[])
20+
[source,powershell]
21+
-----
22+
> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force
23+
-----
1524

25+
===== PowerShell Gallery
26+
If you have at least PowerShell 5 or PowerShell 4 with PackageManagement installed, you can use the package manager to fetch Posh-Git for you.
27+
More information about the requirements: (https://docs.microsoft.com/en-us/powershell/gallery/psget/get_psget_module[])
28+
[source,powershell]
29+
-----
30+
> Update-Module PowerShellGet -Force
31+
> Install-Module Posh-Git -Scope LocalMachine
32+
-----
33+
If you want to install Posh-Git only for the currnet user and not globaly, use "-Scope CurrentUser" instead.
34+
35+
===== From Source
36+
Just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowershell` directory.
37+
Then open a Powershell prompt as an administrator, and do this:
1638
[source,powershell]
1739
-----
18-
> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
1940
> cd ~\Documents\WindowsPowerShell\posh-git
2041
> .\install.ps1
2142
-----

0 commit comments

Comments
 (0)