Hi,
I have one file (inputs.conf) which i want to edited through script. I am pasting first 3 lines of the inputs.conf file below to get script easily understand –
#[SplunkAzure://Collection1]
#storageAccountKey = Your storage account key
#storageAccountName = Your storage account name
Now i have a script given below –
$webConfig = 'C:\Program Files\SplunkUniversalForwarder\etc\apps\SplunkAzure\local\inputs.conf'
Get-Content $webConfig
$obj = 'SplunkAzure://Collection1' | where {$_storageAccountKey -eq 'Your storage account key'}
$obj.storageAccountKey = '78945'
Now when i am trying to replace "78945" with 'Your storage account key' its given below error –
The property 'storageAccountKey' cannot be found on this object. Verify that the property exists and can be set.At D:\Ankit\data\CentOS\New folder\scripts\inputsfile.ps1:4 char:1
+ $obj.storageAccountKey = '78945' .. Any suggestions .. Kindly advise..
Thanks
Ankit