You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* dropping files
* unified code
* adding blank tests file
* updated new cmdlet decumentation and readme
* first update-module tests
* advanced removal
* unattended installation requires force
* changelog
* Linux path update
* more diagnostics
* export nef function
* OS specific PSModulesPath split
* get-module and get-installedmodule difference
* silent installation for better test log
* supported psm1 only modules
* external help updated
Copy file name to clipboardexpand all lines: Docs/InstallModuleFromGit-help.xml
+164-2
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
<maml:description>
13
13
<maml:para>This cmdlet will check for existence of PowerShell module in given repository and return its version. You can also specify desired git branch.</maml:para>
14
14
<maml:para>Cmdlet requires `git` client tool to work. It will download (`git clone`) specified repository to temporary directory and analyze it. By default, it will delete this temporary copy, but if needed, it can be kept.</maml:para>
15
-
<maml:para>Cmdlet searches for module manifest ( .psd1) file only. Modules with only .psm1 files are not supported at the moment.</maml:para>
15
+
<maml:para>Cmdlet searches for module manifest ( .psd1) file or if that is not found for module (.psm1) file itself.</maml:para>
<maml:para>You can also specify desired git branch.</maml:para>
163
163
<maml:para>Cmdlet internally uses `Get-GitModule` cmdlet, so it requires `git` client tool to work. Cmdlet will actually download specified repository to user's default install directory for PowerShell modules.</maml:para>
164
164
<maml:para>It does not support functionality `-Scope AllUsers`, but it is possible to specify `-DestinationPath` argument which will provide the same result.</maml:para>
165
-
<maml:para>Cmdlet searches for module manifest ( .psd1) file only. Modules with only .psm1 files are not supported at the moment.</maml:para>
165
+
<maml:para>Cmdlet searches for module manifest ( .psd1) file or if that is not found for module (.psm1) file itself.</maml:para>
166
166
<maml:para>Note that this will not import module, only install it (the same as built-in cmdlet `Install-Module`). You can rely on PowerShell's automatic import of modules into user session when needed.</maml:para>
<maml:para>This cmdlet updates previously installed PowerShell module specified by its git repository URL if repository contains newer version than installed one.</maml:para>
315
+
</maml:description>
316
+
</command:details>
317
+
<maml:description>
318
+
<maml:para>This cmdlet updates previously installed PowerShell module specified by its git repository URL if repository contains newer version than installed one.</maml:para>
319
+
<maml:para>You can also specify desired git branch.</maml:para>
320
+
<maml:para>Cmdlet internally uses `Get-GitModule` cmdlet, so it requires `git` client tool to work. Cmdlet will actually download specified repository to user's default install directory for PowerShell modules.</maml:para>
321
+
<maml:para>Cmdlet searches for module manifest ( .psd1) file or if that is not found for module (.psm1) file itself.</maml:para>
322
+
<maml:para>If you do not have the same module already installed, commandlet will throw an error.</maml:para>
323
+
<maml:para>Note that this will not import module, only install it (the same as built-in cmdlet `Update-Module`). You can rely on PowerShell's automatic import of modules into user session when needed.</maml:para>
<maml:para>Mandatory parameter specifying URL or the repository. Multiple values are supported. Parameter is passed to `git` client, so whatever works there is good value. For example, in GitHub URLs you can specify parameter both with or without `.git` at the end of URL.</maml:para>
332
+
<maml:para>You can pass this parameter also via pipeline, for example via `Find-Module` built-in cmdlet.</maml:para>
<maml:para>If you have a specific setup, you can override default install location with this parameter. As cmdlet always installs to user specific location, this can be useful to perform system wide installation (requires also elevated prompt).</maml:para>
<maml:para>If DestinationPath location is not empty, commandlet will not install newer version there. This behavior can be overridden with -Force switch.</maml:para>
<maml:para>If you have a specific setup, you can override default install location with this parameter. As cmdlet always installs to user specific location, this can be useful to perform system wide installation (requires also elevated prompt).</maml:para>
<maml:para>If DestinationPath location is not empty, commandlet will not install newer version there. This behavior can be overridden with -Force switch.</maml:para>
<maml:para>Mandatory parameter specifying URL or the repository. Multiple values are supported. Parameter is passed to `git` client, so whatever works there is good value. For example, in GitHub URLs you can specify parameter both with or without `.git` at the end of URL.</maml:para>
419
+
<maml:para>You can pass this parameter also via pipeline, for example via `Find-Module` built-in cmdlet.</maml:para>
This cmdlet updates previously installed PowerShell module specified by its git repository URL if repository contains newer version than installed one.
This cmdlet updates previously installed PowerShell module specified by its git repository URL if repository contains newer version than installed one.
23
+
24
+
You can also specify desired git branch.
25
+
26
+
Cmdlet internally uses \`Get-GitModule\` cmdlet, so it requires \`git\` client tool to work.
27
+
Cmdlet will actually download specified repository to user's default install directory for PowerShell modules.
28
+
29
+
Cmdlet searches for module manifest ( .psd1) file or if that is not found for module (.psm1) file itself.
30
+
31
+
If you do not have the same module already installed, commandlet will throw an error.
32
+
33
+
Note that this will not import module, only install it (the same as built-in cmdlet \`Update-Module\`).
34
+
You can rely on PowerShell's automatic import of modules into user session when needed.
Updates the most downloadable PowerShell module directly from GitHub. If you do not have it installed, it will throw an error.
44
+
45
+
## PARAMETERS
46
+
47
+
### -Branch
48
+
Optional parameter that specifies which branch should be cloned.
49
+
If omitted, \`master\` branch will be used.
50
+
51
+
```yaml
52
+
Type: String
53
+
Parameter Sets: (All)
54
+
Aliases:
55
+
56
+
Required: False
57
+
Position: Named
58
+
Default value: None
59
+
Accept pipeline input: False
60
+
Accept wildcard characters: False
61
+
```
62
+
63
+
### -DestinationPath
64
+
If you have a specific setup, you can override default install location with this parameter.
65
+
As cmdlet always installs to user specific location, this can be useful to perform system wide installation (requires also elevated prompt).
66
+
67
+
```yaml
68
+
Type: String
69
+
Parameter Sets: (All)
70
+
Aliases:
71
+
72
+
Required: False
73
+
Position: Named
74
+
Default value: None
75
+
Accept pipeline input: False
76
+
Accept wildcard characters: False
77
+
```
78
+
79
+
### -Force
80
+
If DestinationPath location is not empty, commandlet will not install newer version there.
81
+
This behavior can be overridden with -Force switch.
82
+
83
+
```yaml
84
+
Type: SwitchParameter
85
+
Parameter Sets: (All)
86
+
Aliases:
87
+
88
+
Required: False
89
+
Position: Named
90
+
Default value: None
91
+
Accept pipeline input: False
92
+
Accept wildcard characters: False
93
+
```
94
+
95
+
### -ProjectUri
96
+
Mandatory parameter specifying URL or the repository.
97
+
Multiple values are supported.
98
+
Parameter is passed to \`git\` client, so whatever works there is good value.
99
+
For example, in GitHub URLs you can specify parameter both with or without \`.git\` at the end of URL.
100
+
101
+
You can pass this parameter also via pipeline, for example via \`Find-Module\` built-in cmdlet.
102
+
103
+
```yaml
104
+
Type: String[]
105
+
Parameter Sets: (All)
106
+
Aliases:
107
+
108
+
Required: True
109
+
Position: 0
110
+
Default value: None
111
+
Accept pipeline input: True (ByPropertyName)
112
+
Accept wildcard characters: False
113
+
```
114
+
115
+
### CommonParameters
116
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Copy file name to clipboardexpand all lines: InstallModuleFromGit.psd1
+1-1
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Description = 'Installs module from Git repository (i.e. GitHUb or Azure DevOps)
69
69
# NestedModules = @()
70
70
71
71
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
if (!$RemoteModuleInfo-or ($RemoteModuleInfo.Count-gt1)) {continue} # we have the error in get-gitmodule
44
+
$ModuleName=$RemoteModuleInfo.Name
45
+
46
+
# TODO: continue only after cleanup!
47
+
48
+
# Check version, and if higher install it
49
+
$AllModules=@((Get-Module-Name $ModuleName-ListAvailable),(Get-InstalledModule-Name $ModuleName)) | Select Name, Version
50
+
$LocalModuleInfo=$AllModules|Sort-Object Version -Descending | Select -First 1
51
+
if (!$LocalModuleInfo) {
52
+
Write-Error"$FunctionName cannot find local module '$ModuleName'"
53
+
continue
54
+
}
55
+
if ($LocalModuleInfo.Version-ge$RemoteModuleInfo.Version) {
56
+
Write-Verbose"$(Get-Date-f T) not updating module '$ModuleName', local version $($LocalModuleInfo.Version), remote version $($RemoteModuleInfo.Version)"
Copy file name to clipboardexpand all lines: README.md
+12-6
Original file line number
Diff line number
Diff line change
@@ -57,12 +57,6 @@ PS:\> (Install-GitModule 'https://github.com/iricigor/psaptgetupdate').Name | Im
57
57
58
58
The module Install Module From Git exposes two new commandlets. More info on module [here](/Docs/InstallModuleFromGit.md).
59
59
60
-
Module provides updatable help system, though it is working currently only on Windows PowerShell. Tracking issue is [here](https://github.com/iricigor/InstallModuleFromGit/issues/3).
61
-
62
-
```PowerShell
63
-
Update-Help -Module InstallModuleFromGit -Force
64
-
```
65
-
66
60
### Get-GitModule
67
61
68
62
Checks for module existence and returns its version. More info [here](/Docs/Get-GitModule.md).
@@ -71,6 +65,18 @@ Checks for module existence and returns its version. More info [here](/Docs/Get-
71
65
72
66
Installs PowerShell module to user's default install folder. More info [here](/Docs/Install-GitModule.md).
73
67
68
+
### Update-GitModule
69
+
70
+
Updates previously installed PowerShell module if Git repository contains newer version. More info [here](/Docs/Update-GitModule.md).
71
+
72
+
### Commands Help System
73
+
74
+
Module provides updatable help system, though it is working currently only on Windows PowerShell. Tracking issue is [here](https://github.com/iricigor/InstallModuleFromGit/issues/3).
75
+
76
+
```PowerShell
77
+
Update-Help -Module InstallModuleFromGit -Force
78
+
```
79
+
74
80
## Tests
75
81
76
82
:smirk: Module has testing against two platforms - Linux and Windows. Code is verified before and after merging to master branch. Tests results are available on the Tests tab ([example here](/img/TestResults-AzureDevops.png)).
0 commit comments