You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PowerShellNotebookDSL.ps1
+116Lines changed: 116 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -255,3 +255,119 @@ function New-PSNotebook {
255
255
}
256
256
257
257
}
258
+
functionNew-SQLNotebook {
259
+
<#
260
+
.SYNOPSIS
261
+
Creates a new PowerShell Notebook that can be returned as text or saves as a `ipynb` file.
262
+
263
+
.Description
264
+
New-PSNotebook takes a script block in which these two functions can be be use to contstruct a PowerShell Notebook `Add-NotebookMarkdown`, `Add-NotebookCode`.
265
+
Additionally, you can use the `-IncludeCodeResults` switch to execute the PowerSHell code and include the results in the notebook.
266
+
267
+
.Example
268
+
# creates a new notebook, and saves it as TestNotebook.ipynb
269
+
270
+
New-PSNotebook -NoteBookName .\TestNotebook {
271
+
Add-NotebookMarkdown -markdown "# This is a H1 tag"
272
+
Add-NotebookCode -code 'Hello World'
273
+
}
274
+
275
+
.Example
276
+
# creates a new notebook, executes the PowerShell then includes it the block, and saves it as TestNotebook.ipynb
0 commit comments