`Remove-DbaAgentJob` - `nvarchar` `-Job` Support & Consider `PurgeHistory` / `Drop` Methods

オープン 初心者向け
#10,871 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
powershell, sql
領域
database

調査の方向性

バグは public/Remove-DbaAgentJob.ps1 にあります。141行目付近で、ジョブ名が N プレフィックスなしで @job_name パラメーターに渡されているため、Unicode 名では失敗します。まず issue に記載された New-DbaAgentJob と Remove-DbaAgentJob のパイプラインで再現し、その SQL 文字列でジョブ名がどのようにクォートされているかを確認してください。Unicode 名のジョブがエラーなしで削除できれば完了です。PurgeHistory と Drop による API の提案は、別途検討すべき、より大きな設計上の問題です。

索引モデルが issue の本文から書いたものです。

説明

bugs life triage required
Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No error. Simplest fix is to use an N'' string on @job_name parameter.
https://github.com/dataplat/dbatools/blob/f60caabe92c95a1baa0bd35c1ed546dfa4b345ff/public/Remove-DbaAgentJob.ps1#L141

I'd encourage moving to use api on Job with PurgeHistory and Drop ( with keepUnusedSchedule param ).

Steps to Reproduce
#Requires -Version 6
New-DbaAgentJob sqli -Job "t`u{02BC}" -Disabled -Description 'test unicode' | Remove-DbaAgentJob 
Please confirm that you are running the most recent version of dbatools

2.9.2

Other details or mentions

Depending on the change here, it could make #10870 irrelevant.

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

NA

SQL Server Edition and Build number

NA

.NET Framework Version

NA

主要言語
PowerShell
スター
2.9k
フォーク
869
平均マージ
2日 4時間
マージ済み PR(30日)
38

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dataplat/dbatools のほかの issue

dataplat/dbatools の issue をすべて見る

似ている issue

Databases の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。