Scripts/Utility/Set-CohesityRestoreMSSQLObject.ps1
function Set-CohesityRestoreMSSQLObject { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$True, DontShow=$True)] [object[]]$MSSQLObjects = $null ) Begin { [CohesityConfig]$configObject = [CohesityConfig]::New() $configFileName = $configObject.ConfigFileName $cohesityFolder = $configObject.ConfigFolder # check if the folder exists if ($false -eq [System.IO.Directory]::Exists("$HOME/" + $cohesityFolder)) { $newFolder = New-Item -Path "$HOME/" -Name $cohesityFolder -ItemType "directory" } $cmdletConfigPath = "$HOME/" + $cohesityFolder + "/" + $configFileName if ($false -eq [System.IO.File]::Exists($cmdletConfigPath)) { $configObject | ConvertTo-Json -depth 100 | Out-File $cmdletConfigPath } } Process { Write-Host $MSSQLObjects } End { } } |