File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,25 +213,29 @@ task ZipRelease LayoutModule, {
213213Synopsis: Install newly built PSReadLine
214214#>
215215task Install LayoutModule, {
216- $InstallDir = " $HOME \Documents\WindowsPowerShell\Modules"
217216
218- if (! (Test-Path - Path $InstallDir ))
219- {
220- New-Item - ItemType Directory - Force $InstallDir
221- }
217+ function Install ($InstallDir ) {
218+ if (! (Test-Path - Path $InstallDir ))
219+ {
220+ New-Item - ItemType Directory - Force $InstallDir
221+ }
222222
223- try
224- {
225- if (Test-Path - Path $InstallDir \PSReadLine)
223+ try
226224 {
227- Remove-Item - Recurse - Force $InstallDir \PSReadLine - ErrorAction Stop
225+ if (Test-Path - Path $InstallDir \PSReadLine)
226+ {
227+ Remove-Item - Recurse - Force $InstallDir \PSReadLine - ErrorAction Stop
228+ }
229+ Copy-Item - Recurse $targetDir $InstallDir
230+ }
231+ catch
232+ {
233+ Write-Error - Message " Can't install, module is probably in use."
228234 }
229- Copy-Item - Recurse $targetDir $InstallDir
230- }
231- catch
232- {
233- Write-Error - Message " Can't install, module is probably in use."
234235 }
236+
237+ Install " $HOME \Documents\WindowsPowerShell\Modules"
238+ Install " $HOME \Documents\PowerShell\Modules"
235239}
236240
237241<#
You can’t perform that action at this time.
0 commit comments