File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -213,25 +213,29 @@ task ZipRelease LayoutModule, {
213
213
Synopsis: Install newly built PSReadLine
214
214
#>
215
215
task Install LayoutModule, {
216
- $InstallDir = " $HOME \Documents\WindowsPowerShell\Modules"
217
216
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
+ }
222
222
223
- try
224
- {
225
- if (Test-Path - Path $InstallDir \PSReadLine)
223
+ try
226
224
{
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."
228
234
}
229
- Copy-Item - Recurse $targetDir $InstallDir
230
- }
231
- catch
232
- {
233
- Write-Error - Message " Can't install, module is probably in use."
234
235
}
236
+
237
+ Install " $HOME \Documents\WindowsPowerShell\Modules"
238
+ Install " $HOME \Documents\PowerShell\Modules"
235
239
}
236
240
237
241
<#
You can’t perform that action at this time.
0 commit comments