Skip to content

Set-DbaAgentJobOutputFile: also report the current output file name #9646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

ReeceGoding
Copy link
Contributor

@ReeceGoding ReeceGoding commented Apr 10, 2025

Closes #9645

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes Set-DbaAgentJobOutputFile should report what you have set the new output to #9645 )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (Invoke-ManualPester)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

To show the file that you have changed your output file to rather than what it was.

Approach

Just added one line and renamed another.

I have not added more documentation for $Step. I think it is doing more than I'm guessing at. I'd rather leave that to hands that have used it for more than a week.

Commands to test

Just run Set-DbaAgentJobOutputFile.

Screenshots

Old version, when running Set-DbaAgentJobOutputFile -SqlInstance $ins -Job 'Job One' -OutPutFile 'foo.txt' . Note that it makes no mention of foo.txt.

image

New version, when running Set-DbaAgentJobOutputFile -SqlInstance $ins -Job 'Job One' -OutPutFile 'foo34445578.txt'. Note that it shows my silly old name as well as my silly new one.

image

Learning

This was my grand excuse to install PowerShell on Linux.

Copy link
Contributor

@niphlod niphlod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks backwards compatibility: OutputFileName should be set to $OutputFile (I think it is indeed, an error, to set it to $currentOutputFile which is the "previous") . That property should stay there. another one can be added and won't break existing scripts if you want to output the previous one too.

@ReeceGoding ReeceGoding requested a review from niphlod April 14, 2025 18:59
@ReeceGoding
Copy link
Contributor Author

@niphlod I think this now matches what you've asked for. I just had to force push a new version after realising that my first attempt was silly.

OutputFileName is now the new file's name. OldOutputFileName is what OutputFileName used to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set-DbaAgentJobOutputFile should report what you have set the new output to
2 participants