Hi,
I've noticed that Import-Ini cannot read .ini files with the Hidden attribute, such as desktop.ini.
Currently, the code uses:
$source = (Get-Item -LiteralPath $source).FullName
This fails for hidden files:
Import-Ini -Path "$rootPath\desktop.ini"
Get-Item: Could not find item C:\Root\desktop.ini.
Import-Ini: Could not find file '
After adding the -Force parameter to Get-Item:
$source = (Get-Item -LiteralPath $source -Force).FullName
The import works correctly:
Import-Ini -Path "$rootPath\desktop.ini"
Name Value
---- -----
.ShellClassInfo {[LocalizedResourceName, Тест], [IconResource, %WINDIR%\System32\SHELL32.dll,84]}
Proposed fix:
Update line 120 in Import-Ini.ps1 to include -Force when calling Get-Item.
This should allow the module to read .ini files that are marked as hidden.
Thanks!
Hi,
I've noticed that
Import-Inicannot read.inifiles with theHiddenattribute, such asdesktop.ini.Currently, the code uses:
This fails for hidden files:
After adding the
-Forceparameter toGet-Item:The import works correctly:
Proposed fix:
Update line 120 in
Import-Ini.ps1to include-Forcewhen callingGet-Item.This should allow the module to read
.inifiles that are marked as hidden.Thanks!