File tree Expand file tree Collapse file tree 3 files changed +36
-28
lines changed Expand file tree Collapse file tree 3 files changed +36
-28
lines changed Original file line number Diff line number Diff line change 1
1
[
2
- " 0install" ,
3
- " BuildHelpers" ,
4
- " ChocolateyGet" ,
5
- " Dotted" ,
6
- " Foil" ,
7
- " GistProvider" ,
8
- " GitHubProvider" ,
9
- " InvokeBuild" ,
2
+ " DockerCompletion" ,
10
3
" oh-my-posh" ,
11
- " Pester" ,
12
- " Plaster" ,
13
- " platyPS" ,
14
4
" posh-git" ,
15
5
" powershell-yaml" ,
16
- " PowerShellBuild" ,
17
6
" psake" ,
18
- " Pscx" ,
19
- " PSFzf" ,
20
- " PSScriptAnalyzer" ,
7
+ " PSReadLine" ,
21
8
" PSWindowsUpdate" ,
22
- " PSWinSetup" ,
23
- " PSWinVitals" ,
24
9
" PSWriteColor" ,
25
- " RobocopyPS" ,
26
- " Sampler" ,
27
- " Stucco" ,
10
+ " scoop-completion" ,
28
11
" Terminal-Icons" ,
29
- " UtilityFunctions" ,
30
- " WinGet" ,
31
- " WinRegistry" ,
32
- " WslInterop" ,
33
12
" ZLocation"
34
13
]
Original file line number Diff line number Diff line change
1
+ - DockerCompletion
2
+ - oh-my-posh
3
+ - posh-git
4
+ - powershell-yaml
5
+ - psake
6
+ - PSReadLine
7
+ - PSWindowsUpdate
8
+ - PSWriteColor
9
+ - scoop-completion
10
+ - Terminal-Icons
11
+ - ZLocation
Original file line number Diff line number Diff line change @@ -17,10 +17,28 @@ $env:POSH_GIT_ENABLED = $true
17
17
# --------
18
18
19
19
Function Backup-Modules {
20
- $savefile = " $env: OneDrive \Documents\PowerShell\modules.json"
21
- if (Test-Path $savefile ) { Rename-Item - Path $savefile - NewName ($savefile + " .bak" ) }
22
- $mods = Get-ChildItem - Path $env: OneDrive \Documents\PowerShell\Modules - Directory
23
- $mods.Name | ConvertTo-Json > $savefile
20
+ $modpath = ($env: PSModulePath -split " ;" )[0 ]
21
+ $ymlpath = " $modpath \modules.yml"
22
+ $jsonpath = " $modpath \modules.json"
23
+ $mods = (Get-ChildItem $modpath - Directory).Name
24
+ If (! (Get-Module - Name powershell- yaml - ErrorAction SilentlyContinue)) {
25
+ ConvertTo-Json $mods > $jsonpath
26
+ } else {
27
+ ConvertTo-Yaml - Data $mods - OutFile $ymlpath - Force
28
+ }
29
+
30
+ }
31
+
32
+ Function Sync-Modules {
33
+ $psdir = (Split-Path - Parent $profile )
34
+ Set-Location $psdir
35
+ git pull
36
+ git add PowerShell/ Modules/**
37
+ git commit - m " config: Updated modules configurations"
38
+ git- cliff - o " $HOME \Documents\CHANGELOG.md"
39
+ git add CHANGELOG.md
40
+ git commit - m " doc: update CHANGELOG.md for added modules"
41
+ git push
24
42
}
25
43
26
44
Function Restore-Modules {
You can’t perform that action at this time.
0 commit comments