Skip to content

Commit a432645

Browse files
committed
Change Install task to also install for PSCore
1 parent 73dfa57 commit a432645

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

PSReadLine.build.ps1

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,29 @@ task ZipRelease LayoutModule, {
213213
Synopsis: Install newly built PSReadLine
214214
#>
215215
task 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
<#

0 commit comments

Comments
 (0)