Jekyll2022-12-07T14:22:21+00:00https://wsmelton.github.io/feed.xmlPowerShell and AutomationLearning more on PowerShell and automation. Shawn Melton[email protected]Poly what?2022-11-29T00:00:00+00:002022-11-29T00:00:00+00:00https://wsmelton.github.io/2022/11/29/poly-what<p>You may be aware of PowerShell supported Jupyter Notebooks as many in the community have posted about it over the past few years:</p> <ul> <li>Douge Finke’s <a href="https://github.com/dfinke/powershell-notebooks">PowerShell 101 notebooks</a></li> <li><a href="2020-03-09-powershell-notebooks">Self published post</a> from March 2020</li> <li>Aaron Nelson’s <a href="https://sqlvariant.com/2019/11/powershell-notebooks-are-available-in-azure-data-studio/">PowerShell Notebooks are Available in Azure Data Studio</a></li> <li>Rob Sewell’s <a href="https://sqldbawithabeard.com/2020/02/07/new-net-notebooks-are-here-powershell-7-notebooks-are-here/">New .NET Notebooks are here - PowerShell 7 notebooks are here</a></li> </ul> <p>These are still around with a new name and features!</p> <h2 id="polyglot-notebooks">Polyglot Notebooks</h2> <p>Claudio Regio posted the announcement earlier this month on the 3rd that <a href="https://devblogs.microsoft.com/dotnet/dotnet-interactive-notebooks-is-now-polyglot-notebooks/">.NET Interactive Notebooks is now Polyglot Notebooks!</a></p> <p>They brought support for a ton of language kernels with a bit of rebranding and improvements that benefit us. One of the biggest things to me is the ability to mix and match kernels in a single notebook. You can create a notebook using PowerShell and for documentation mix in dynamically generating a Mermaid diagram if you wanted.</p> <p>If you watched the <a href="https://www.dotnetconf.net/">.NET Conf 2022</a> that occurred a few weeks ago Claudio did a great overview of using these notebooks and will give you a great starting point:</p> <ul> <li><a href="https://youtu.be/IXRGa5m-Lbo">The Power of Polyglot Notebooks - .NET Conf 2022</a></li> </ul> <p><strong>Be sure</strong> to check out the <a href="https://github.com/dotnet/interactive/blob/main/docs/magic-commands.md">magic commands</a>!!!</p> <h2 id="setup">Setup</h2> <p>Open up VS Code on your machine and then install the <a href="https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode">Polyglot Notebooks extension</a> (it is in preview right now). Once that starts up it will prompt you to install any missing .NET/dotnet binaries.</p> <h2 id="magic-commands">Magic Commands</h2> <p>A <a href="https://github.com/dotnet/interactive/blob/main/docs/magic-commands.md">magic command</a> is special scriptable shortcuts that you can use to engage the power of notebooks. A few of these were shown in Claudio’s session (see YouTube link above).</p> <p>You can run <code class="language-plaintext highlighter-rouge">#!lsmagic</code> in a code cell within a new notebook and this will give you a list of all the current magic commands available.</p> <p><img src="https://user-images.githubusercontent.com/11204251/204588124-06eae531-2be5-484c-a14e-0aacf20c8a26.png" alt="image" /></p> <p>Once you identify a given command you can use <code class="language-plaintext highlighter-rouge">--help</code> to get details about that command and the flags/parameters available to it.</p> <p><img src="https://user-images.githubusercontent.com/11204251/204588697-0c64c3d0-251f-4bfd-a477-7ebb88c044d0.png" alt="image" /></p>Shawn Melton[email protected]You may be aware of PowerShell supported Jupyter Notebooks as many in the community have posted about it over the past few years:Azure Cloud Service Emulators2022-11-12T00:00:00+00:002022-11-12T00:00:00+00:00https://wsmelton.github.io/2022/11/12/az-emulators<p><a href="https://www.flaticon.com/free-icons/travel" title="travel icons"><img src="https://user-images.githubusercontent.com/11204251/201482432-a757fffb-c2e0-4b36-9fd1-5db1902ea67a.png" alt="Travel icons created by Icongeek26 - Flaticon" width="150" /></a></p> <p>Air plane mode, a required setting if you travel in an airplane. Depending on where you are going whether it is for work, school, vacation, or because I want to you may have a lot of time on your flight. Are you looking to learn more about Azure’s cloud services? Want to change careers to be a developer? Did you Azure offers the ability for you to develop against some of their services in 100% offline mode? You don’t even need an Internet connection.</p> <p>If you have already started your journey developing against Azure you may already be aware of the amazing list of <a href="https://azure.microsoft.com/en-us/downloads/">Azure Developer tools</a>.</p> <h2 id="azure-emulators">Azure Emulators</h2> <p>Below are a list of emulators that Azure offers at the time of writing. Please review documentation and EULA to identify any special requirements or limitations on approved usage. In most cases these are for development purposes only, some you can use with your testing pipelines.</p> <ul> <li> <p><a href="https://learn.microsoft.com/en-us/azure/cosmos-db/local-emulator?WT.mc_id=CDM-MVP-5002856">Azure Cosmos DB</a> Allows you to have a local environment that emulates the Azure Cosmos DB service. It also supports migrating data between the emulator and Azure Cosmos DB service using the <a href="https://github.com/azure/azure-documentdb-datamigrationtool">Azure Cosmos DB Data Migration Tool</a>.</p> </li> <li> <p><a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/local-dev-experience-sql-database-emulator?WT.mc_id=CDM-MVP-5002856">Azure SQL Database</a> This one will require Docker as the emulator is a containerized application that will run on your local system. You have the option when you spin the emulator up to do Full or Lite. Lite has the smallest footprint image and is based on Azure SQL Edge’s base image. There are some features in Azure SQL that are <a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/local-dev-experience-sql-database-emulator?view=azuresql#limitations&amp;WT.mc_id=CDM-MVP-5002856">not supported</a>. You can use this for automation testing as well in your deployment pipelines.</p> </li> <li> <p><a href="https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code&amp;WT.mc_id=CDM-MVP-5002856">Azure Storage</a> The new version uses Azurite platform is cross-platform supported, and this supersides the old <a href="https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator?WT.mc_id=CDM-MVP-5002856">Azure Storage Emulator</a>. This can also be used in your deployment pipelines.</p> </li> <li> <p><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-local#local-development-environments?WT.mc_id=CDM-MVP-5002856">Azure Function Apps</a> This one would not be a true “emulator” but provides a local environment runtime that allows you to execute and spin up your Function App without having to be connected to the Azure Cloud service. It also supports communicating with the emulators above for a complete development environment.</p> </li> </ul>Shawn Melton[email protected]Azure PowerShell - Get-AzComputeResourceSku2022-09-20T00:00:00+00:002022-09-20T00:00:00+00:00https://wsmelton.github.io/2022/09/20/az-compute-sku-details<h2 id="compute-resource-skus">Compute Resource Skus</h2> <p>I have bookmarks on almost any machine I’m using for work that point to the Sku details for both Virtual Machines and Disks:</p> <ul> <li> <p><a href="https://learn.microsoft.com/en-us/azure/virtual-machines/sizes?WT.mc_id=CDM-MVP-5002856">Virtual Machine Sizes</a></p> </li> <li> <p><a href="https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types?WT.mc_id=CDM-MVP-5002856">Azure Managed Disk Types</a></p> </li> </ul> <p>The above pages give you a table view of the Virtual Machine skus and the disk types (e.g. HHD, SSD, SSD v2). They are a constant reference when I’m working on sizing a new project that requires any virtual machine. I wanted to get this all into Excel so I could more easily reference it. I also use Excel to size out builds to ensure I’m meeting capacity and throughput requirements for vendor solutions/products.</p> <h2 id="powershell-script">PowerShell script</h2> <p>The below script will use <code class="language-plaintext highlighter-rouge">Get-AzComputeResourceSku</code> command to pull the details from the REST API and dump that into an Excel file.</p> <script src="https://gist.github.com/wsmelton/3c2984918106d808027a38b60f2ece06.js"></script>Shawn Melton[email protected]Compute Resource SkusAKS Management - Tip 12022-09-04T00:00:00+00:002022-09-04T00:00:00+00:00https://wsmelton.github.io/2022/09/04/aks-management-tips-1<h2 id="aks-management">AKS Management</h2> <p>This is the start of a series of posts as I come across tips and tricks for managing the Azure Kubernetes Service. These may be scripts, utilities (CLI or apps), and other various things that come across my keyboard as I work with AKS.</p> <h3 id="k9s">K9s</h3> <p><img src="https://k9scli.io/assets/k9s.png" width="200" /></p> <p><a href="https://k9scli.io/">K9s</a> is a utility that is a great for helping you get around and discover resources in a Kubernetes cluster through a terminal interface. It takes care of interacting with <code class="language-plaintext highlighter-rouge">kubectl</code> command for you so your cluster could run on-premises or in Azure.</p> <h3 id="get-started">Get Started</h3> <p>You can find the <a href="https://k9scli.io/topics/install/">install instructions</a> offer multiple methods based on your OS and preference. To install this using Chocolatey:</p> <div class="language-console highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="go"> choco install k9s -y </span></code></pre></div></div> <p>You can verify the installation after that by running:</p> <div class="language-console highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="go"> k9s version </span></code></pre></div></div> <p>You will see output similar to:</p> <p><img src="https://user-images.githubusercontent.com/11204251/188331976-c0cf444c-2796-41e3-af96-dfac6de8886b.png" /></p> <h3 id="use">Use</h3> <p>You can run the command with various flags to control what scope it runs for a cluster. If you just run <code class="language-plaintext highlighter-rouge">k9s</code> with no flags, it will open the command-line graphic to the whole cluster.</p> <p><img src="https://user-images.githubusercontent.com/11204251/188332127-0cb5db69-9623-46d8-b41e-b20f01ca1bcc.png" /></p> <p>After you have the application running, there are a few keyboard shortcuts that are useful to help get around. Every screen you will have these quick keys accessible. They are visible on the screen at all times:</p> <p><img src="https://user-images.githubusercontent.com/11204251/188332335-1deeb7b4-1342-4e54-847e-2b05adffabf4.png" /></p> <p>Others to be aware of starting out:</p> <ul> <li> <p><kbd>ESCAPE</kbd> – Escape key is used to go back to the previous screen</p> </li> <li> <p><kbd>:</kbd>+<code class="language-plaintext highlighter-rouge">q</code> – Used to quit the application.</p> </li> <li> <p><kbd>:</kbd> – (colon) will bring a command prompt up where you can type an alias to move around to different areas of the cluster. You can start typing a few characters and intellisense/tab completion will be available.</p> <p><img src="https://user-images.githubusercontent.com/11204251/188332978-96714bab-e3da-4c52-a014-0587b12e48ab.png" /></p> </li> <li> <p><kbd>CTRL</kbd>+<code class="language-plaintext highlighter-rouge">a</code> – this will bring up a complete list of all the alias that you can use in the prompt</p> </li> <li> <p><kbd>SHIFT</kbd>+<code class="language-plaintext highlighter-rouge">f</code> – this bring up a prompt for configuring port-forwarding on the selected pod or container (dependent upon what context your view is on at the time)</p> <p><img src="https://user-images.githubusercontent.com/11204251/188332582-bdd2aabb-3b2c-4bf5-8020-e94921f3ac5d.png" /></p> </li> <li> <p><kbd>:</kbd>+<code class="language-plaintext highlighter-rouge">ctx</code> – the alais <code class="language-plaintext highlighter-rouge">ctx</code> allows you to change context of the current cluster. A big time saver when things are busy.</p> <p><img src="https://user-images.githubusercontent.com/11204251/188332828-16b7a789-d595-4886-9103-aedde3155f19.png" /></p> </li> </ul> <h2 id="closing">Closing</h2> <p>The terminal interaction that K9s offers is extremely useful for those still learning how to get around a cluster using <code class="language-plaintext highlighter-rouge">kubectl</code>. As well, even if you are already familiar with <code class="language-plaintext highlighter-rouge">kubectl</code> it saves a lot typing when you manage several clusters.</p>Shawn Melton[email protected]AKS Management This is the start of a series of posts as I come across tips and tricks for managing the Azure Kubernetes Service. These may be scripts, utilities (CLI or apps), and other various things that come across my keyboard as I work with AKS. K9s K9s is a utility that is a great for helping you get around and discover resources in a Kubernetes cluster through a terminal interface. It takes care of interacting with kubectl command for you so your cluster could run on-premises or in Azure. Get Started You can find the install instructions offer multiple methods based on your OS and preference. To install this using Chocolatey: choco install k9s -y You can verify the installation after that by running: k9s version You will see output similar to: Use You can run the command with various flags to control what scope it runs for a cluster. If you just run k9s with no flags, it will open the command-line graphic to the whole cluster. After you have the application running, there are a few keyboard shortcuts that are useful to help get around. Every screen you will have these quick keys accessible. They are visible on the screen at all times: Others to be aware of starting out: ESCAPE – Escape key is used to go back to the previous screen :+q – Used to quit the application. : – (colon) will bring a command prompt up where you can type an alias to move around to different areas of the cluster. You can start typing a few characters and intellisense/tab completion will be available. CTRL+a – this will bring up a complete list of all the alias that you can use in the prompt SHIFT+f – this bring up a prompt for configuring port-forwarding on the selected pod or container (dependent upon what context your view is on at the time) :+ctx – the alais ctx allows you to change context of the current cluster. A big time saver when things are busy. Closing The terminal interaction that K9s offers is extremely useful for those still learning how to get around a cluster using kubectl. As well, even if you are already familiar with kubectl it saves a lot typing when you manage several clusters.Map Azure Data Disk to VM Disk and Volume2021-12-04T00:00:00+00:002021-12-04T00:00:00+00:00https://wsmelton.github.io/2021/12/04/azure-disk-to-vm-disk<h2 id="lab-case">Lab Case</h2> <p>I need to expand an Azure Storage Account disk that is attached to a particular drive letter in the Azure VM (Windows Server). Before that can be done I need to know what disk the drive letter maps to in Azure.</p> <h3 id="solution">Solution</h3> <p>There are steps that can be used to gather this data from the UI in Windows Server utilizing the Disk Management console, but PowerShell is much more efficient in this use case.</p> <p>The output of the script below will look similar to the following:</p> <div class="language-console highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="go">AzureVMName AzureDiskName DriveLetter LUN PartitionName PartitionSizeGB DiskIndex SCSILogicalUnit DiskSizeGB DiskStatus ----------- ------------- ----------- --- ------------- --------------- --------- --------------- ---------- ---------- </span><span class="gp">VM004DB vm004db-datadisk1 E 0 Disk #</span>2, Partition <span class="c">#0 128 2 0 128 OK</span> <span class="gp">VM004DB vm004db-datadisk2 F 1 Disk #</span>3, Partition <span class="c">#0 4090 3 1 4090 OK</span> <span class="gp">VM004DB vm004db-datadisk3 G 2 Disk #</span>4, Partition <span class="c">#0 4090 4 2 4090 OK</span> </code></pre></div></div> <div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cm">&lt;# </span><span class="cs">.SYNOPSIS</span><span class="cm"> Returns a table providing mapping of Azure Storage disk to Azure VM OS volume. </span><span class="cs">.DESCRIPTION</span><span class="cm"> Script is written to be executed from the admin's local device (adjust to execute through Azure Function or Runbook as desired) Items/Dependencies: - Az CLI (quickest one-liner to get the data) - PowerShell (Windows PowerShell 5.1 or PowerShell 7+) - Network access to Azure VM via WinRM - Azure Account privileges to query VM data - Also assumes the VM name is also the hostname for WinRM access . EXAMPLES .\Get-AzDiskToVmDisk.ps1 -VMName VM004DB -ResourceGroup mystuff -Credential (Get-Secret myAdmin) Uses SecretManagement module to retrieve PSCredential for "myAdmin". Pulls the list of Storage disk assigned to VM "VM004DB", CIM calls to map those to the Disk and Volume in Windows Server </span><span class="cs">.NOTES</span><span class="cm"> Original source: https://github.com/peterlil/script-and-templates/blob/master/az%20cli/iaas/storage/map-azure-disks-to-vm-disks-windows.ps1 #&gt;</span><span class="w"> </span><span class="kr">param</span><span class="p">(</span><span class="w"> </span><span class="p">[</span><span class="n">string</span><span class="p">]</span><span class="w"> </span><span class="nv">$VMName</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">string</span><span class="p">]</span><span class="w"> </span><span class="nv">$ResourceGroup</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">PSCredential</span><span class="p">]</span><span class="nv">$Credential</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="cm">&lt;# Create CIM Session to the provided VM using the credential #&gt;</span><span class="w"> </span><span class="kr">try</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-CimSession</span><span class="w"> </span><span class="nt">-ComputerName</span><span class="w"> </span><span class="nv">$VMName</span><span class="w"> </span><span class="nt">-Credential</span><span class="w"> </span><span class="nv">$Credential</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="kr">catch</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kr">throw</span><span class="w"> </span><span class="s2">"Unable to connect CIM to </span><span class="nv">$VMName</span><span class="s2"> </span><span class="si">$(</span><span class="bp">$_</span><span class="si">)</span><span class="s2">"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="cm">&lt;# Grab the Disk name and LUN number for the VM in Azure #&gt;</span><span class="w"> </span><span class="nv">$azDisks</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">az</span><span class="w"> </span><span class="nx">vm</span><span class="w"> </span><span class="nx">show</span><span class="w"> </span><span class="nt">-n</span><span class="w"> </span><span class="nv">$VMName</span><span class="w"> </span><span class="nt">-g</span><span class="w"> </span><span class="nv">$ResourceGroup</span><span class="w"> </span><span class="nt">--query</span><span class="w"> </span><span class="s2">"storageProfile.dataDisks[].{Name:name, LUN:lun}"</span><span class="w"> </span><span class="nt">--output</span><span class="w"> </span><span class="nx">JSON</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">ConvertFrom-Json</span><span class="w"> </span><span class="cm">&lt;# Using the CIM Session retrieve disk, partition and volume details from Windows Server #&gt;</span><span class="w"> </span><span class="nv">$diskDrives</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-CimInstance</span><span class="w"> </span><span class="nt">-Class</span><span class="w"> </span><span class="nx">Win32_DiskDrive</span><span class="w"> </span><span class="nt">-CimSession</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Sort-Object</span><span class="w"> </span><span class="nt">-Property</span><span class="w"> </span><span class="nx">DeviceID</span><span class="w"> </span><span class="nv">$diskDriveToDiskPartitionMappings</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-CimInstance</span><span class="w"> </span><span class="nt">-Class</span><span class="w"> </span><span class="nx">Win32_DiskDriveToDiskPartition</span><span class="w"> </span><span class="nt">-CimSession</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="nv">$diskPartitions</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-CimInstance</span><span class="w"> </span><span class="nt">-Class</span><span class="w"> </span><span class="nx">Win32_DiskPartition</span><span class="w"> </span><span class="nt">-CimSession</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="nv">$logicalDiskToPartitionMappings</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-CimInstance</span><span class="w"> </span><span class="nt">-Class</span><span class="w"> </span><span class="nx">Win32_LogicalDiskToPartition</span><span class="w"> </span><span class="nt">-CimSession</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="nv">$logicalDisks</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-CimInstance</span><span class="w"> </span><span class="nt">-Class</span><span class="w"> </span><span class="nx">Win32_LogicalDisk</span><span class="w"> </span><span class="nt">-CimSession</span><span class="w"> </span><span class="nv">$cimSession</span><span class="w"> </span><span class="kr">foreach</span><span class="w"> </span><span class="p">(</span><span class="nv">$diskDrive</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$diskDrives</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$diskDrive</span><span class="o">.</span><span class="nf">InterfaceType</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="s1">'SCSI'</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="c"># Get partition mappings for the current drive</span><span class="w"> </span><span class="nv">$diskDriveToDiskPartitionMapping</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$diskDriveToDiskPartitionMappings</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Where-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">$_</span><span class="o">.</span><span class="nf">Antecedent</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="nv">$diskDrive</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="nv">$azDiskName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="nv">$azDisks</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Where-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">$_</span><span class="o">.</span><span class="nf">LUN</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="nv">$diskDrive</span><span class="o">.</span><span class="nf">SCSILogicalUnit</span><span class="w"> </span><span class="p">})</span><span class="o">.</span><span class="nf">Name</span><span class="w"> </span><span class="kr">if</span><span class="p">(</span><span class="nv">$diskDriveToDiskPartitionMapping</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nv">$diskDriveToDiskPartitionMapping</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">ForEach-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nv">$partitionMapping</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">$_</span><span class="w"> </span><span class="nv">$diskPartition</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$diskPartitions</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Where-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">$_</span><span class="o">.</span><span class="nf">Name</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="nv">$partitionMapping</span><span class="o">.</span><span class="nf">Dependent</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="nv">$logicalDiskToPartitionMapping</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$logicalDiskToPartitionMappings</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Where-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">$_</span><span class="o">.</span><span class="nf">Antecedent</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="nv">$partitionMapping</span><span class="o">.</span><span class="nf">Dependent</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="kr">if</span><span class="p">(</span><span class="nv">$logicalDiskToPartitionMapping</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nv">$logicalDisk</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$logicalDisks</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Where-Object</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">$_</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="nv">$logicalDiskToPartitionMapping</span><span class="o">.</span><span class="nf">Dependent</span><span class="o">.</span><span class="nf">DeviceID</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="kr">if</span><span class="p">(</span><span class="nv">$logicalDisk</span><span class="o">.</span><span class="nf">DeviceID</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nv">$deviceId</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$logicalDisk</span><span class="o">.</span><span class="nf">DeviceID</span><span class="o">.</span><span class="nf">Trim</span><span class="p">(</span><span class="s1">':'</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">[</span><span class="n">pscustomobject</span><span class="p">]@{</span><span class="w"> </span><span class="nx">AzureDiskName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$azDiskName</span><span class="w"> </span><span class="nx">DriveLetter</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$deviceId</span><span class="w"> </span><span class="nx">LUN</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$DiskDrive</span><span class="err">.</span><span class="nx">SCSILogicalUnit</span><span class="w"> </span><span class="nx">PartitionName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$diskPartition</span><span class="err">.</span><span class="nx">Name</span><span class="w"> </span><span class="nx">PartitionSizeGB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">math</span><span class="p">]</span><span class="err">::</span><span class="nx">Round</span><span class="err">(</span><span class="nv">$diskPartition</span><span class="err">.</span><span class="nx">Size</span><span class="w"> </span><span class="err">/</span><span class="w"> </span><span class="mi">1</span><span class="nx">GB</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="err">)</span><span class="w"> </span><span class="nx">DiskIndex</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$DiskDrive</span><span class="err">.</span><span class="nx">Index</span><span class="w"> </span><span class="nx">SCSILogicalUnit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$DiskDrive</span><span class="err">.</span><span class="nx">SCSILogicalUnit</span><span class="w"> </span><span class="nx">DiskSizeGB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">math</span><span class="p">]</span><span class="err">::</span><span class="nx">Round</span><span class="err">(</span><span class="nv">$DiskDrive</span><span class="err">.</span><span class="nx">Size</span><span class="w"> </span><span class="err">/</span><span class="w"> </span><span class="mi">1</span><span class="nx">GB</span><span class="err">)</span><span class="w"> </span><span class="nx">DiskStatus</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$DiskDrive</span><span class="err">.</span><span class="nx">Status</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="nv">$logicalDisk</span><span class="p">,</span><span class="nv">$logicalDiskToPartitionMapping</span><span class="p">,</span><span class="nv">$diskDriveToDiskPartitionMapping</span><span class="p">,</span><span class="nv">$deviceId</span><span class="p">,</span><span class="nv">$diskPartition</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">$null</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span></code></pre></div></div>Shawn Melton[email protected]Lab Case I need to expand an Azure Storage Account disk that is attached to a particular drive letter in the Azure VM (Windows Server). Before that can be done I need to know what disk the drive letter maps to in Azure. Solution There are steps that can be used to gather this data from the UI in Windows Server utilizing the Disk Management console, but PowerShell is much more efficient in this use case. The output of the script below will look similar to the following: AzureVMName AzureDiskName DriveLetter LUN PartitionName PartitionSizeGB DiskIndex SCSILogicalUnit DiskSizeGB DiskStatus ----------- ------------- ----------- --- ------------- --------------- --------- --------------- ---------- ---------- VM004DB vm004db-datadisk1 E 0 Disk #2, Partition #0 128 2 0 128 OK VM004DB vm004db-datadisk2 F 1 Disk #3, Partition #0 4090 3 1 4090 OK VM004DB vm004db-datadisk3 G 2 Disk #4, Partition #0 4090 4 2 4090 OK &lt;# .SYNOPSIS Returns a table providing mapping of Azure Storage disk to Azure VM OS volume. .DESCRIPTION Script is written to be executed from the admin's local device (adjust to execute through Azure Function or Runbook as desired) Items/Dependencies: - Az CLI (quickest one-liner to get the data) - PowerShell (Windows PowerShell 5.1 or PowerShell 7+) - Network access to Azure VM via WinRM - Azure Account privileges to query VM data - Also assumes the VM name is also the hostname for WinRM access . EXAMPLES .\Get-AzDiskToVmDisk.ps1 -VMName VM004DB -ResourceGroup mystuff -Credential (Get-Secret myAdmin) Uses SecretManagement module to retrieve PSCredential for "myAdmin". Pulls the list of Storage disk assigned to VM "VM004DB", CIM calls to map those to the Disk and Volume in Windows Server .NOTES Original source: https://github.com/peterlil/script-and-templates/blob/master/az%20cli/iaas/storage/map-azure-disks-to-vm-disks-windows.ps1 #&gt; param( [string] $VMName, [string] $ResourceGroup, [PSCredential]$Credential ) &lt;# Create CIM Session to the provided VM using the credential #&gt; try { $cimSession = New-CimSession -ComputerName $VMName -Credential $Credential } catch { throw "Unable to connect CIM to $VMName $($_)" } &lt;# Grab the Disk name and LUN number for the VM in Azure #&gt; $azDisks = az vm show -n $VMName -g $ResourceGroup --query "storageProfile.dataDisks[].{Name:name, LUN:lun}" --output JSON | ConvertFrom-Json &lt;# Using the CIM Session retrieve disk, partition and volume details from Windows Server #&gt; $diskDrives = Get-CimInstance -Class Win32_DiskDrive -CimSession $cimSession | Sort-Object -Property DeviceID $diskDriveToDiskPartitionMappings = Get-CimInstance -Class Win32_DiskDriveToDiskPartition -CimSession $cimSession $diskPartitions = Get-CimInstance -Class Win32_DiskPartition -CimSession $cimSession $logicalDiskToPartitionMappings = Get-CimInstance -Class Win32_LogicalDiskToPartition -CimSession $cimSession $logicalDisks = Get-CimInstance -Class Win32_LogicalDisk -CimSession $cimSession foreach ($diskDrive in $diskDrives) { if ($diskDrive.InterfaceType -eq 'SCSI') { # Get partition mappings for the current drive $diskDriveToDiskPartitionMapping = $diskDriveToDiskPartitionMappings | Where-Object { $_.Antecedent.DeviceID -eq $diskDrive.DeviceID } $azDiskName = ($azDisks | Where-Object { $_.LUN -eq $diskDrive.SCSILogicalUnit }).Name if($diskDriveToDiskPartitionMapping) { $diskDriveToDiskPartitionMapping | ForEach-Object { $partitionMapping = $_ $diskPartition = $diskPartitions | Where-Object { $_.Name -eq $partitionMapping.Dependent.DeviceID } $logicalDiskToPartitionMapping = $logicalDiskToPartitionMappings | Where-Object { $_.Antecedent.DeviceID -eq $partitionMapping.Dependent.DeviceID } if($logicalDiskToPartitionMapping) { $logicalDisk = $logicalDisks | Where-Object { $_.DeviceID -eq $logicalDiskToPartitionMapping.Dependent.DeviceID } } if($logicalDisk.DeviceID) { $deviceId = $logicalDisk.DeviceID.Trim(':') } [pscustomobject]@{ AzureDiskName = $azDiskName DriveLetter = $deviceId LUN = $DiskDrive.SCSILogicalUnit PartitionName = $diskPartition.Name PartitionSizeGB = [math]::Round($diskPartition.Size / 1GB, 1) DiskIndex = $DiskDrive.Index SCSILogicalUnit = $DiskDrive.SCSILogicalUnit DiskSizeGB = [math]::Round($DiskDrive.Size / 1GB) DiskStatus = $DiskDrive.Status } } } $logicalDisk,$logicalDiskToPartitionMapping,$diskDriveToDiskPartitionMapping,$deviceId,$diskPartition = $null } }Installing SSRS on Server Core2021-10-18T00:00:00+00:002021-10-18T00:00:00+00:00https://wsmelton.github.io/2021/10/18/install-ssrs-on-server-core<h2 id="lab-case">Lab Case</h2> <p>I need to install SQL Server Reporting Services (SSRS) on Window Server 2019 Core (non-gui).</p> <h3 id="steps">Steps</h3> <ol> <li> <p>Download installer:</p> <p>SSRS has to be downloaded separately from the SQL Server media. You can find that download <a href="https://www.microsoft.com/en-us/download/details.aspx?id=100122">here</a></p> </li> <li>Server Core allows for the installer wizard to be used, put the <code class="language-plaintext highlighter-rouge">exe</code> on the server and run it.</li> <li>Complete the install wizard.</li> <li> <p>Once the installation completes run the configuration tool using the following command:</p> <div class="language-console highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="go"> &amp; 'C:\Program Files\Microsoft SQL Server Reporting Services\Shared Tools\RSConfigTool.exe' </span></code></pre></div> </div> </li> <li>Complete the configuration options desired.</li> </ol> <p>You will access the web UI via <code class="language-plaintext highlighter-rouge">http://&lt;server&gt;/Reports</code></p>Shawn Melton[email protected]Lab Case I need to install SQL Server Reporting Services (SSRS) on Window Server 2019 Core (non-gui). Steps Download installer: SSRS has to be downloaded separately from the SQL Server media. You can find that download here Server Core allows for the installer wizard to be used, put the exe on the server and run it. Complete the install wizard. Once the installation completes run the configuration tool using the following command: &amp; 'C:\Program Files\Microsoft SQL Server Reporting Services\Shared Tools\RSConfigTool.exe' Complete the configuration options desired. You will access the web UI via http://&lt;server&gt;/ReportsGit - Configure Global Email2021-09-03T00:00:00+00:002021-09-03T00:00:00+00:00https://wsmelton.github.io/2021/09/03/git-configure-global-email<p>If you work with GitHub or other hosted version control systems they all work with Git. One of the things Git does when you first try and push (or write) to a hosted Git repository is prompt you to login. GitHub when you do this by default will link all of your commits made to the default email address you have configured on your profile.</p> <h2 id="what-email-is-used">What Email is used?</h2> <p>Under your profile settings in GitHub you can identify what email address(es) is configured by looking under the <code class="language-plaintext highlighter-rouge">Emails</code> section:</p> <p><img src="https://user-images.githubusercontent.com/11204251/132080102-d02ee008-afa2-41c2-8312-3af369f5feae.png" alt="image" /></p> <p>You can configure multiple but a default, primary will be configured as the first email you used to create your account. As you add additional emails you can then change when address is your primary.</p> <h2 id="secure-your-email-address">Secure Your Email Address</h2> <p>If you are not aware, a common practice these days is companies are trolling contributors and maintainers of open-source projects. I have personally had it happen a few times, and had one company tell me they got my email from the commit history of dbatools.</p> <p>A method that can help you keep this from happening is enabling the two settings below under the Emails section of your profile on GitHub:</p> <p><img src="https://user-images.githubusercontent.com/11204251/132080178-4071c473-901d-4cae-954c-32808ba556dc.png" alt="image" /></p> <p>When you enable the <code class="language-plaintext highlighter-rouge">Keep my email address private</code> you will see a no-reply email address is generated and provided. The email name is generated from your username on GitHub, prefixed with a randomly generated 8-digit number.</p> <p>In addition, you can check the box for blocking commits that are using your private email from being pushed to GitHub’s site.</p> <h2 id="configure-git-global-email">Configure Git Global Email</h2> <p>Once you have installed Git client on your machine you can configure the global setting for your email to be set to that no-reply address. Setting this globally prevents the need of setting it on each local repository.</p> <p>Easiest way to do this is using the Git UI that comes with the client.</p> <p>After you open the Git Gui, you first need to open an existing repository on your machine. You can then go to <strong>Edit &gt; Options</strong> and will see on the right side the Global settings.</p> <p><img src="https://user-images.githubusercontent.com/11204251/132080419-a5a5be0d-1d1c-45cc-9fd4-1f4aed796b23.png" alt="image" /></p> <p>Replace the current email address with your no-reply, and then <strong>click Save</strong> at the bottom of the window.</p> <p>I have added this as a setup step on any new machine I setup now.</p>Shawn Melton[email protected]If you work with GitHub or other hosted version control systems they all work with Git. One of the things Git does when you first try and push (or write) to a hosted Git repository is prompt you to login. GitHub when you do this by default will link all of your commits made to the default email address you have configured on your profile. What Email is used? Under your profile settings in GitHub you can identify what email address(es) is configured by looking under the Emails section: You can configure multiple but a default, primary will be configured as the first email you used to create your account. As you add additional emails you can then change when address is your primary. Secure Your Email Address If you are not aware, a common practice these days is companies are trolling contributors and maintainers of open-source projects. I have personally had it happen a few times, and had one company tell me they got my email from the commit history of dbatools. A method that can help you keep this from happening is enabling the two settings below under the Emails section of your profile on GitHub: When you enable the Keep my email address private you will see a no-reply email address is generated and provided. The email name is generated from your username on GitHub, prefixed with a randomly generated 8-digit number. In addition, you can check the box for blocking commits that are using your private email from being pushed to GitHub’s site. Configure Git Global Email Once you have installed Git client on your machine you can configure the global setting for your email to be set to that no-reply address. Setting this globally prevents the need of setting it on each local repository. Easiest way to do this is using the Git UI that comes with the client. After you open the Git Gui, you first need to open an existing repository on your machine. You can then go to Edit &gt; Options and will see on the right side the Global settings. Replace the current email address with your no-reply, and then click Save at the bottom of the window. I have added this as a setup step on any new machine I setup now.GitHub Web Editor2021-08-11T00:00:00+00:002021-08-11T00:00:00+00:00https://wsmelton.github.io/2021/08/11/github-web-editor<h2 id="github-web-editor-is-here">GitHub Web Editor is here</h2> <p>I am actually writing this blog post using GitHub’s new Web Editor experience. In this post, I’ll go over what it is and how you use it.</p> <h3 id="first---how-to-open-it">First - How to open it</h3> <p>To get the new web editor experience, you need to use the keyboard shortcuts that GitHub provides. Did you know they provide a good bit? You can open the shortcut menu that gives you the everyday use ones by using <kbd>Shift</kbd>+<kbd>?</kbd> to bring it up:</p> <p><img src="https://user-images.githubusercontent.com/11204251/129115211-749e5ef4-f287-408d-bb0e-62cc057b5bc4.png" alt="view of keyboard shortcuts" /></p> <p>You can see that first one <code class="language-plaintext highlighter-rouge">Open in github.dev editor</code> by pressing the <kbd>.</kbd> (period).</p> <h3 id="what-is-it">What Is It?</h3> <p>The short answer is a web-based version of VS Code minus most features:</p> <p><img src="https://user-images.githubusercontent.com/11204251/129114646-f87fc925-b1b8-495d-aabb-2a0bbe5d2cff.png" alt="view of web editor with markdown text" /></p> <p>It offers a next-generation experience for contributors and editors to interact with their (or other) GitHub projects via a browser.</p> <h3 id="what-does-not-work">What does not work?</h3> <p>Remember, it is an editor, nothing more. You will find that many extensions in VS Code require storage and processing ability to operate, and none of those will work.</p> <p>You can find by searching the marketplace while you have the web editor open and see many are not supported:</p> <p><img src="https://user-images.githubusercontent.com/11204251/129115981-fdfa15a8-3675-4c21-ac73-f85d79cafb92.png" alt="image" /></p> <h3 id="what-good-is-it">What good is it?</h3> <p>Contributors can use the web editor for contributions in many ways. Number one thing maintainers love is to help fix documentation errors, and the web editor provides a significant step in making that more accessible. If you need to make a minor correction to fix your pull request or adjust code based on feedback, all of that can be done with the web editor.</p> <p>Maintainers and contributors can use the web editor for doing Pull Request Reviews:</p> <p><img src="https://user-images.githubusercontent.com/11204251/129116585-d6ff1200-1cc3-48ba-af72-d5e36ebd6556.png" alt="image" /></p> <p>Any form of contribution is greatly appreciated, and the new web editor experience helps provide users with a more robust experience. Try it out!</p> <p>You can also access any repository now with the web editor by using <code class="language-plaintext highlighter-rouge">github.dev</code> instead of <code class="language-plaintext highlighter-rouge">github.com</code> for the URL. As an example <a href="github.dev/sqlcollaborative/dbatools">github.dev/sqlcollaborative/dbatools</a> will open the web editor directly.</p>Shawn Melton[email protected]GitHub Web Editor is here I am actually writing this blog post using GitHub’s new Web Editor experience. In this post, I’ll go over what it is and how you use it. First - How to open it To get the new web editor experience, you need to use the keyboard shortcuts that GitHub provides. Did you know they provide a good bit? You can open the shortcut menu that gives you the everyday use ones by using Shift+? to bring it up: You can see that first one Open in github.dev editor by pressing the . (period). What Is It? The short answer is a web-based version of VS Code minus most features: It offers a next-generation experience for contributors and editors to interact with their (or other) GitHub projects via a browser. What does not work? Remember, it is an editor, nothing more. You will find that many extensions in VS Code require storage and processing ability to operate, and none of those will work. You can find by searching the marketplace while you have the web editor open and see many are not supported: What good is it? Contributors can use the web editor for contributions in many ways. Number one thing maintainers love is to help fix documentation errors, and the web editor provides a significant step in making that more accessible. If you need to make a minor correction to fix your pull request or adjust code based on feedback, all of that can be done with the web editor. Maintainers and contributors can use the web editor for doing Pull Request Reviews: Any form of contribution is greatly appreciated, and the new web editor experience helps provide users with a more robust experience. Try it out! You can also access any repository now with the web editor by using github.dev instead of github.com for the URL. As an example github.dev/sqlcollaborative/dbatools will open the web editor directly.GitHub Issue Forms Beta2021-07-19T00:00:00+00:002021-07-19T00:00:00+00:00https://wsmelton.github.io/2021/07/19/github-issue-forms<h2 id="forms-are-finally-here">Forms are Finally Here</h2> <p>June 23, GitHub announced <a href="https://github.blog/changelog/2021-06-23-issues-forms-beta-for-public-repositories/">Issue Forms beta for public repositories</a>. If you are a maintainer of an open-source project on GitHub, issues are the lifeblood of your project for your userbase to interact and report bugs and features. <a href="https://docs.github.com/en/discussions">Discussions</a> is also an option but most generally stick with using GitHub Issues.</p> <p>GitHub uses YAML for GitHub Actions and various other features in repositories that let you define what you want in code rather than using a UI. Issue Forms uses this and a change from the markdown style that we use up to this point.</p> <p>The use of Issue Forms allows you more control over what users can input on a specific issue. In the markdown style, all we can do is provide comments or suggestions, and as users submit them, we hope for the best. If you get many users that simply select all text and remove it, then your template serves no purpose. Issue Forms helps with all of this and gives you the control of at least asking them for specific details in a given text box, drop-down, or checkbox.</p> <p>An example drop-down option, where you can also see the red <code class="language-plaintext highlighter-rouge">*</code> that means a selection has to be done before the issue can be submitted.</p> <p><img src="https://user-images.githubusercontent.com/11204251/126049353-0d3421af-a362-404b-a710-4883c7844311.png" alt="image" /></p> <p>The only requirement for using this feature currently is the repository has to be public. I created a public repository, <a href="https://github.com/wsmelton/testing-issue-templates/tree/main/.github/ISSUE_TEMPLATE">wsmelton/testing-issue-templates</a> if you would like to see a few live and interact with them.</p> <p>I’ve also implemented them for the following projects I am a maintainer for as well:</p> <ul> <li><a href="https://github.com/sqlcollaborative/dbatools">dbatools</a></li> <li><a href="https://github.com/thycotic-ps/thycotic.secretserver">Thycotic.SecretServer</a></li> </ul> <h2 id="more-information">More Information</h2> <p>More details on the Issue Forms:</p> <ul> <li><a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository">Configuring Issue Templates</a></li> <li><a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms">YAML Syntax Issue Forms</a></li> <li><a href="https://github.com/github/feedback/discussions/categories/issues-feedback">Issue Forms Feedback</a></li> </ul>Shawn Melton[email protected]Forms are Finally HereVS Code New Window Size2020-11-17T00:00:00+00:002020-11-17T00:00:00+00:00https://wsmelton.github.io/2020/11/17/vscode-newwindow-size<p>If you use <a href="https://code.visualstudio.com/">VS Code</a>, you may have found that when you have a current workspace open and want to open a new one, it may be sized extremely small. Mine would always open to around 300x500 and be positioned in the center of the screen.</p> <p>Windows has support for saving the window size by holding the <code class="language-plaintext highlighter-rouge">Shift</code> key down while closing the window (click the <code class="language-plaintext highlighter-rouge">x</code>). I tried this with no result; the window continued to open up smaller than the original window.</p> <p>I decided to check the user settings of Code. I searched for <code class="language-plaintext highlighter-rouge">window size</code> and found the setting that controls that new window sizing:</p> <div class="language-console highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="go">window.newWindowDimensions </span></code></pre></div></div> <p>Each option controls what size and position you get for the window:</p> <table> <thead> <tr> <th>Setting</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>default</td> <td>Open new windows in the center of the screen</td> </tr> <tr> <td>inherit</td> <td>Open new windows with same dimensions as last active one</td> </tr> <tr> <td>offset</td> <td>Open new windows with same dimensions as last active one with an offset position</td> </tr> <tr> <td>maximized</td> <td>Open new windows maximized</td> </tr> <tr> <td>fullscreen</td> <td>Open new windows in full screen mode</td> </tr> </tbody> </table> <p>So fix for that small screen being opened is merely adjusting the setting. I am using <code class="language-plaintext highlighter-rouge">offset</code> for now, and it works like a charm.</p>Shawn Melton[email protected]If you use VS Code, you may have found that when you have a current workspace open and want to open a new one, it may be sized extremely small. Mine would always open to around 300x500 and be positioned in the center of the screen.