Skip to content

Commit 9588a2a

Browse files
Retire PS1 in migration script and add steps
Update the migration guide to document retiring the PS1 wrapper when migrating to the C# cmdlet. Adds steps to archive the PS1 file, remove the function from dbatools FunctionsToExport, add the cmdlet to dbatools.library CmdletsToExport, and adjust commit instructions to include commits in both dbatools.library and dbatools (including Co-Authored-By lines). Also renumbers sections accordingly and clarifies the final test/run and tracker update workflow.
1 parent 6e3f868 commit 9588a2a

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

scripts/migrate-prompt.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,28 @@ error behavior). Report which tests need adaptation and suggest fixes."
228228

229229
Fix any issues reported by these specialized reviewers before proceeding to Step 10.
230230

231-
### 10. Final Test Run
231+
### 10. Retire the PS1 Function
232+
233+
The C# cmdlet replaces the PS1 function. Both cannot coexist — PowerShell will error on duplicate command names. Perform these steps in the **dbatools repo** (`c:\github\dbatools`):
234+
235+
#### 10a. Archive the PS1 file
236+
237+
Move the PS1 to an `archive/` folder (gitignored — for reference only, the original is in git history):
238+
239+
```bash
240+
mkdir -p c:/github/dbatools/archive
241+
mv c:/github/dbatools/public/{CommandName}.ps1 c:/github/dbatools/archive/{CommandName}.ps1
242+
```
243+
244+
#### 10b. Remove from dbatools FunctionsToExport
245+
246+
Edit `c:\github\dbatools\dbatools.psd1` — remove `'{CommandName}'` from the `FunctionsToExport` array.
247+
248+
#### 10c. Add to dbatools.library CmdletsToExport
249+
250+
Edit `c:\github\dbatools.library\dbatools.library.psd1` — add `'{CommandName}'` to the `CmdletsToExport` array. Keep the array sorted alphabetically.
251+
252+
### 11. Final Test Run
232253

233254
Re-run the test suite one last time after all quality gate fixes:
234255

@@ -238,13 +259,15 @@ dotnet test project/dbatools.Tests/dbatools.Tests.csproj --no-build --verbosity
238259

239260
Compare against the baseline from Step 0. All previously passing tests must still pass. If not, fix and re-run before committing.
240261

241-
### 11. Update Tracker and Commit
262+
### 12. Update Tracker and Commit
242263

243264
1. Edit the tracker file: change status from `PENDING` to `DONE`
244265
2. Fill in the C# File, Build, and Parity columns
245-
3. Commit:
266+
3. Commit in **dbatools.library** repo:
246267
```bash
268+
cd c:/github/dbatools.library
247269
git add project/dbatools/Commands/{Verb}{Noun}Command.cs
270+
git add dbatools.library.psd1
248271
git add docs/plan/TRACKER-MIGRATE-*.md
249272
git commit -m "$(cat <<'EOF'
250273
feat(migration): Convert {Command-Name} to C# binary cmdlet
@@ -254,13 +277,31 @@ feat(migration): Convert {Command-Name} to C# binary cmdlet
254277
- Build passes
255278
- Tests pass (baseline maintained)
256279
- Feature parity verified
280+
- PS1 retired, cmdlet exported from dbatools.library
281+
282+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
283+
EOF
284+
)"
285+
```
286+
287+
4. Commit in **dbatools** repo:
288+
```bash
289+
cd c:/github/dbatools
290+
git add -u public/{CommandName}.ps1
291+
git add dbatools.psd1
292+
git commit -m "$(cat <<'EOF'
293+
feat(migration): Retire {Command-Name} PS1 — now C# binary cmdlet
294+
295+
- Function removed from FunctionsToExport
296+
- PS1 archived (C# implementation in dbatools.library)
257297
258298
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
259299
EOF
260300
)"
301+
cd c:/github/dbatools.library
261302
```
262303

263-
4. **STOP** — do not continue to the next command.
304+
5. **STOP** — do not continue to the next command.
264305

265306
## C# Reference: What's Available in DbaBaseCmdlet
266307

0 commit comments

Comments
 (0)