The latest release of the insiders edition of Azure Data Studio brings the first edition of PowerShell Notebooks!
You can download the latest insiders edition from the link above, it can be installed alongside the stable release.
To access many of the commands available use F1 to open the command palette (like many of my tips this also works in Visual Studio Code). You can then start typing to get the command that you want.
![](https://i0.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-8.png?w=630&ssl=1)
You can then hit enter with the command that you want highlighted, use the mouse or use the shortcut which is displayed to the right.
In a new notebook, you can click the drop down next to kernel and now you can see that PowerShell is available
![](https://i1.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-9.png?w=630&ssl=1)
When you choose the PowerShell kernel, you will get a prompt asking you to configure the Python installation
![](https://i1.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-10.png?fit=630%2C916&ssl=1)
If you have Python already installed you can browse to the location that it is installed or you can install Python. In the bottom pane you will be able to see the progress of the installation.
![](https://i0.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-11.png?fit=630%2C103&ssl=1)
When it has completed, you will see
![](https://i2.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-12.png?fit=630%2C104&ssl=1)
You may also get a prompt asking if you would like to upgrade some packages
![](https://i1.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-13.png?w=630&ssl=1)
Again this will be displayed in the tasks pane
![](https://i1.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-14.png?fit=630%2C154&ssl=1)
Adding PowerShell
To add PowerShell Code to the notebook click the Code button at the top of the file
![](https://i1.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-15.png?w=630&ssl=1)
or the one you can find by highlighting above or below a block
![](https://i2.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-16.png?w=630&ssl=1)
I did not have intellisense, but you can easily write your code in Azure Data Studio or Visual Studio Code and paste it in the block.
Interestingly Shawn Melton ( t ) did
This was because he had the PowerShell extension installed and I did not (I know !!)
If you find you dont have intellisense then install the PowerShell extension!
![](https://i0.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-17.png?w=630&ssl=1)
Clicking the play button (which is only visible when you hover the mouse over it) will run the code
You can clear the results from every code block using the clear results button at the top
![](https://i2.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-18.png?w=630&ssl=1)
Otherwise, you can save the results with the Notebook by saving it. This is the part that is missing from running PowerShell in the Markdown blocks in a SQL Notebook as I described here
![](https://i2.wp.com/sqldbawithabeard.com/wp-content/uploads/2019/10/image-19.png?fit=630%2C246&ssl=1)
I am looking forward to how this develops. You can find my sample PowerShell notebook (with the code results) here