I have a properties file(.properties), which has contents in this format:-
[1]TYPE=4
[1]ENABLED=TRUE
[1]Caption = "Kozos"
[1]URL=https://kozos.com/access
I want to display the value of url for kozos and when i try below code, i get an error :-
ConvertFrom-StringData : Data line 'D:\kozos.properties' is not in 'name=value' format.Clear-host $FileName = "D:\kozos.properties" $file_content = $FileName -join [Environment]::NewLine $configuration = ConvertFrom-StringData($file_content) $environment = $configuration.'kozos' Write-host "Environment is $environment"