Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Created January 29, 2021 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SQLvariant/b8a5f17f9019106d65498133c6d099ae to your computer and use it in GitHub Desktop.
Save SQLvariant/b8a5f17f9019106d65498133c6d099ae to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"kernelspec": {
"name": "powershell",
"display_name": "PowerShell",
"language": "powershell"
},
"language_info": {
"name": "powershell",
"codemirror_mode": "shell",
"mimetype": "text/x-sh",
"file_extension": ".ps1"
}
},
"nbformat_minor": 2,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": [
"# Quick recap of my demos for C# Corner's SQL Server Virtual Conference\r\n",
"## SQL Notebooks\r\n",
"\r\n",
"Download the SQL Tiger Team's Best Practices Check from [aka.ms/BPCheck](https://aka.ms/BPCheck) or use the command below to download the file directly."
],
"metadata": {
"azdata_cell_guid": "a765deca-5113-47c8-84f1-d4373c06844d"
}
},
{
"cell_type": "code",
"source": [
"Invoke-RestMethod https://raw.githubusercontent.com/microsoft/tigertoolbox/master/BPCheck/BPCheck.ipynb -OutFile BPCheck.ipynb"
],
"metadata": {
"azdata_cell_guid": "c62531c1-491a-4825-95ad-6be6695e0fdb"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": ""
}
],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"Use [this PowerShell Notebook](https://github.com/SQLvariant/Demos/blob/master/Presentations/Intro-to-Jupyter-Notebooks/8.How-Can-I-Automate-SQL-Notebooks/How-Can-I-Automate-SQL-Notebooks.ipynb) ➡ to automate the SQL Notebook above ⤴"
],
"metadata": {
"azdata_cell_guid": "06948092-b082-4c42-aeb3-7bccb33414bb"
}
},
{
"cell_type": "markdown",
"source": [
"## PowerShell Notebook for Building SQL Container with Parameters\n",
"\n",
"Available in my Gists: [Use Invoke-ExecuteNotebook to build a SQL-on-Linux instance in a Docker container, by calling Invoke-ExecuteNotebook to execute the Notebook, and passing in the sa\\_password & digits for the name/port number to the Notebook as a parameter. (github.com)](https://gist.github.com/SQLvariant/472021981475d1cd917ac07205a2bcc3)\n",
"\n",
"Use the PowerShellNotebook module to help automate execution of your PowerShell Notebooks"
],
"metadata": {
"azdata_cell_guid": "1288efbb-4ed0-4a64-bda3-f69320575de7"
}
},
{
"cell_type": "code",
"source": [
"Invoke-ExecuteNotebook -InputNotebook .\\SQL-on-Docker-with-PowerShell.ipynb -Parameters @{sa_password = 'Test9999'; SQLNumber = 97}"
],
"metadata": {
"azdata_cell_guid": "faea4ff3-6cef-4678-9540-62209fb2f482"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": ""
}
],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"## Dig deeper into PowerShell Notebooks with the examples in my [GitHub repo](https://github.com/SQLvariant/Demos/tree/master/Presentations/Intro-to-Jupyter-Notebooks):\r\n",
"https://github.com/SQLvariant/Demos/tree/master/Presentations/Intro-to-Jupyter-Notebooks"
],
"metadata": {
"azdata_cell_guid": "66ae330d-923d-42c4-9706-2d32da150095"
}
},
{
"cell_type": "markdown",
"source": [
"## Power BI\n",
"\n",
"My PowerShell for Power BI presentation is done almost exclusively with PowerShell Notebooks: [Demos/Presentations/PowerShell-for-PowerBI at master · SQLvariant/Demos (github.com)](https://github.com/SQLvariant/Demos/tree/master/Presentations/PowerShell-for-PowerBI)"
],
"metadata": {
"azdata_cell_guid": "8bafbaf6-456b-4102-a269-b30151482fe6"
}
},
{
"cell_type": "code",
"source": [
"Login-PowerBI\r\n\r\nInvoke-ExecuteNotebook -InputNotebook .\\ExportPowerBIWorkspaceAssets_NotebookAutomation.ipynb -OutputNotebook .\\PowerBI_DataGovernance.ipynb -Force"
],
"metadata": {
"azdata_cell_guid": "7e8f1f39-3b9d-46fc-8747-ade8e34969e6"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": ""
}
],
"execution_count": null
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment