I am trying to call a function that adds an outlook calendar event; however, I have to call the function using different creds. so, I was trying this:
$daystodeletebackup = 30 $date = (get-date).AddDays($daystodeletebackup) $newdate = $date.ToString('MM/dd/yyyy HH:mm') $newdate $DatabaseName = "Database" $SQLInstanceName = "Server" $creds = Get-Credential Start-Process powershell.exe -Credential $creds Add-CalendarMeeting -subject "DELETE BACKUP FILE" -Body "DELETE Backup File from DECOMMISSIONED database $DatabaseName on Server $SQLInstanceName" -Location $SQLInstanceName -MeetingStart $newdate -Reminder 30
But I get an error: System.Management.Automation.ParameterBindingException: A parameter cannot be found that matches parameter name 'subject'
If I run it and comment out everything past Add-CalendarMeeting it will work but I have to enter in the parameters. Is there anyway for me to pass the parameters into the new PS window?