Skip to content

Commit

Permalink
Find workaround to PS session cache refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanAgainstMachine committed Oct 20, 2024
1 parent ca0a472 commit c19523d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion localmodules/LocalModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = '.\LocalModules.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# Supported PSEditions
CompatiblePSEditions = @('Core')
Expand Down Expand Up @@ -112,6 +112,11 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = @'
[ver 1.0.1] - 2024-10-20
* Fix Get-LInstalledModule displaying non-installed local modules in certain cases.
* Fix Uninstall-LModule preventing the uninstallation of a local module when a repository version is present.
* Find workaround to PS session cache refresh
[ver 1.0.0] - 2024-10-20
* Improve vars and cmdlets names
* Improve manifest
Expand Down
7 changes: 4 additions & 3 deletions localmodules/LocalModules.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ function Install-LModule {
New-ModuleManifest -Path $ver0ManifestPath -RootModule ".\$moduleName.psm1" -ModuleVersion '0.0.0'
Write-Host "A minimal manifest has been installed because you don't have one" -ForegroundColor DarkYellow
}
Import-Module -Name $moduleName -Force
Write-Host "Local module $moduleName successfully installed" -ForegroundColor Green

Write-Host "Local module $moduleName successfully installed" -ForegroundColor Green
Write-Host "Close and reopen the PowerShell console to restart the session and see the changes." -ForegroundColor DarkYellow
}
}
else {
Expand Down Expand Up @@ -121,6 +121,7 @@ from there. I recommend uninstalling the repository version to avoid confusion.

Remove-Item -Path $ver0ModulePath -Recurse -Force
Write-Host "Local module $Name successfully uninstalled" -ForegroundColor Green
Write-Host "Close and reopen the PowerShell console to restart the session and see the changes." -ForegroundColor DarkYellow

} else {
Write-Host "Local module $Name not found" -ForegroundColor Red
Expand Down

0 comments on commit c19523d

Please sign in to comment.