I’m trying to find the log firectory location by connecting to SQL database and store the log file in that location.We have standard log directory with naming convention. After i get the director from sql database, i need to create two more subdirectories and append the log file into that location ( for log file i’m using add-log file and pslogging function ).
I’m able to get the log directory information from sql database but script is failing to create the new directories and append the path near add-file command.
Here’s the error :
Cannot convert ‘System.Object’ to the type ‘System.String’ required by parameter ‘FilePath’. Specified method is not supported.
At C:\Program Files\CommVault\Simpana\Base\final2.ps1:306 char:25
- $template_xml | Out-File <<<< $Output -Encoding ascii
- CategoryInfo : InvalidArgument: ( [Out-File], ParentContainsErrorRecordException
- FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.OutFileCommand
Please find the attached powershell script and please let me know if i miss anything.
Thanks in advance.