So below should contain the relevant piece of code, and I do think this is some sort of permissions issue. I can edit my file with notepad & run my executable jar. However, If I am viewing the EXACT SAME file but edited via my powershell script using my the same credentials then the program exits immediately with error "java.lang.NumberFormatException: null." However, This error is still refering to the same exact file if you follow the trace. So, I'm at a loss. Any ideas based on this info? The files really are the same, because i've even copied over the new file content generated from the powershell into the OLD file, and it that old file WORKS! I've checked the properties & the security profile as well. They are identical minus size. (one is double the size) Still, checked in notepad++, and didn't see anything.
$properties = Get-Content $filename
foreach ($item in $properties) {
if ($item -like '*a=*'){
$oldValue = $item.substring(5)
write-host "changing $oldValue to $newa"
$item = $item.Replace($oldValue, $newa)
} elseif ($item -like '*sql_column=*')
{
$oldValue = $item.substring(11)
write-host "changing $oldValue to $sqlColumn"
$item = $item.Replace($oldValue, $sqlColumn)
}elseif ($item -like '*sql=*')
{
$oldValue = $item.substring(4)
write-host "changing $oldValue to $sqlQuery"
$item = $item.Replace($oldValue, $sqlQuery)
}
$out = $out + $item
}
Clear-Content "C:\app\vapp.properties"
$out >> "C:\app\vapp.properties"
#mv "C:\app\vapp.properties" "C:\app\vapp.properties"
#|out-file -FilePath "C:\app\vapp.properties"
write-host "changed file to Transaction Type: $TransType"