ModuleFast icon indicating copy to clipboard operation
ModuleFast copied to clipboard

Update Profile with ModuleFast module path reports successful even if profile doesnt exist

Open JustinGrote opened this issue 1 year ago • 1 comments

This happened in vscode remoting to a windows machine but may be present elsewhere:

PS C:\Users\ESRT-Allied\Documents\PowerShell\Scripts> imf -verbose
VERBOSE: Updating PSModulePath to include C:\Users\ESRT-Allied\AppData\Local\powershell\Modules
VERBOSE: Using relative path $([environment]::GetFolderPath('LocalApplicationData'))\powershell\Modules instead of 'C:\Users\ESRT-Allied\AppData\Local\powershell\Modules' in profile
VERBOSE: Checked for relative destination
VERBOSE: PSModulePath $([environment]::GetFolderPath('LocalApplicationData'))\powershell\Modules already in profile, skipping...
VERBOSE: 🔎 No modules specified to install. Beginning SpecFile detection...
Install-ModuleFast: Could not find any required spec files in C:\Users\ESRT-Allied\Documents\PowerShell\Scripts. Verify the path is correct or provide Module Specifications either via -Path or -Specification
PS C:\Users\ESRT-Allied\Documents\PowerShell\Scripts> $profile
C:\Users\ESRT-Allied\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
PS C:\Users\ESRT-Allied\Documents\PowerShell\Scripts> cat $profile
Get-Content: Cannot find path 'C:\Users\ESRT-Allied\Documents\PowerShell\Microsoft.PowerShell_profile.ps1' because it does not exist.
PS C:\Users\ESRT-Allied\Documents\PowerShell\Scripts> gc -raw $profile
Get-Content: Cannot find path 'C:\Users\ESRT-Allied\Documents\PowerShell\Microsoft.PowerShell_profile.ps1' because it does not exist.
PS C:\Users\ESRT-Allied\Documents\PowerShell\Scripts> gc -raw $profile.CurrentUserAllHosts

JustinGrote avatar Mar 20 '24 20:03 JustinGrote

This is less important as we now only do the profile update in much less specificcircumstances

JustinGrote avatar Sep 15 '24 05:09 JustinGrote