Commit b33d8a5
Run optional post-emitter.ps1 script after SDK generation (#47456)
* Run optional post-emitter.ps1 script after SDK generation
Add support for a hard-coded, optional post-emitter PowerShell script
(post-emitter.ps1) located in the generated package folder
(sdk/<service>/azure-*). When present, it is executed after code
generation so service teams (e.g. Foundry) can run custom
post-processing on the generated SDK.
Safety/robustness:
- Only runs a script located directly inside the package folder
(guards against path traversal / symlinks).
- Invoked non-interactively (-NonInteractive -NoProfile).
- Captures and logs stdout/stderr so output is visible in the pipeline.
- Wrapped with a 600s timeout.
- Failures are logged but never fail the overall generation.
- Gracefully skips when no PowerShell (pwsh) executable is available.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Log post-emitter failures/timeout as warning instead of error
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Simplify post-emitter script check to existence only
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rename post-emitter script to _post_emitter.ps1 to signal it is private
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: rename post emitter script to PostEmitter.ps1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Log a message when post-emitter script is not found
Helps debugging when a service team adds the script but does not see it
run. Also fix a stale docstring reference to the script name.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Delete log.txt
* Reference POST_EMITTER_SCRIPT_NAME in docstring instead of hard-coded filename
Avoids the docstring drifting out of sync with the constant (the
previous literal was stale). The constant is now the single source of
truth for the script name.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: iscai-msft <isabellavcai@gmail.com>1 parent b5aae50 commit b33d8a5
1 file changed
Lines changed: 69 additions & 0 deletions
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
54 | 120 | | |
55 | 121 | | |
56 | 122 | | |
| |||
242 | 308 | | |
243 | 309 | | |
244 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
245 | 314 | | |
246 | 315 | | |
247 | 316 | | |
| |||
0 commit comments