Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7764843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:01:12+00:00 2026-06-01T15:01:12+00:00

There’s a question on this already (here) . But I’m hoping that because I’m

  • 0

There’s a question on this already (here). But I’m hoping that because I’m using PowerShell 2, and SQL Server 2008, that I might get different answers if I ask again.

Basically, I have a SQL Server Agent job, which runs a cmd script like so:

powershell "&D:\SQL\Job\JobDir\Upload.ps1 (various arguments including log file name)"

When it runs start-transcript, the file is created, but nothing except a header is written to the file. However, when I run on the command line, everything is logged properly.

I’ve already got lots of logic to manage old log files in the powershell script, and don’t want to just use the default logging that SQL Server Agent provides.

To write out info, I use invoke-sqlcmd with the verbose flag, and also write-message and write-error.

Thanks for any pointers!
Sylvia

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:01:14+00:00Added an answer on June 1, 2026 at 3:01 pm

    Permissions were not an issue for me. I think there’s ways of manipulating the output from powershell very exactly, with all the different output streams (error, verbose, etc), but instead of getting into those details, I just used the default logging that SQL Server agent provides for each job step. It works okay. I still use the logic that I wrote to manage and archive log files in my script, I can do that even though the log file itself is generated by SQL Server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are nice SO question and answers about this issue, but these options didn't
There are plenty of questions and answers to this like this question but I
There is a column that exists in 2 tables. In table 1, this column
There have been multiple questions regarding this topic but I have never really settled
This could be a duplicate question, but I have no idea what search terms
There is a component that I have been using since IE7 and had never
I know there's a lot of other questions out there that deal with this
There are similar questions asked here, but was not able to find something close
There is a moment in my app, that I need to force to show
There's a Rails 3.2.3 web application which doesn't use any database. But in spite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.