Skip to content

Instantly share code, notes, and snippets.

@SQLDBAWithABeard
Last active November 14, 2019 16:05
Show Gist options
  • Save SQLDBAWithABeard/bb0ecef8245f764151e018d09d38f9c5 to your computer and use it in GitHub Desktop.
Save SQLDBAWithABeard/bb0ecef8245f764151e018d09d38f9c5 to your computer and use it in GitHub Desktop.
meta powershell notebook
## This PowerShell will create a PowerShell Notebook which will create a PowerShell Notebook!
# This serves no useful purpose :-)
$introCelltext = "# This notebook will create a notebook"
$SecondCelltext = "### Installation
You can install ADSNotebook from the PowerShell Gallery using `Install-Module ADSNotebook` "
$thirdcelltext = " `$introCelltext = ' # This notebook was created by a notebook '
`$SecondCelltext = '### Installation
You can install ADSNotebook from the PowerShell Gallery using `Install-Module ADSNotebook` '
`$thirdcelltext = 'Install-Module dbatools'
`$Intro = New-ADSWorkBookCell -Type Text -Text `$introCelltext
`$second = New-ADSWorkBookCell -Type Text -Text `$SecondCelltext
`$third = New-ADSWorkBookCell -Type Code -Text `$thirdcelltext
`$path = 'C:\temp\meta.ipynb'
New-ADSWorkBook -Path `$path -cells `$Intro,`$second,`$third -Type PowerShell
azuredatastudio.cmd `$path
"
$Intro = New-ADSWorkBookCell -Type Text -Text $introCelltext
$second = New-ADSWorkBookCell -Type Text -Text $SecondCelltext
$third = New-ADSWorkBookCell -Type Code -Text $thirdcelltext
$path = 'C:\temp\parent.ipynb'
New-ADSWorkBook -Path $path -cells $Intro,$second,$third -Type PowerShell
azuredatastudio.cmd $path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment