• When i am trying to run the script through sql server agent it is showing given error. Could any body can suggest how i can run this by using sql server agent .

    Executed as user: HOMEPC\SYSTEM. A job step received an error at line 2 in a PowerShell script. The corresponding line is 'write-host $args.Count'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Cannot invoke this function because the current host does not implement it. '. Process Exit Code -1. The step failed.