Skip to content

Commit 8a3d87d

Browse files
committed
Update indented code in PS Quickstart
1 parent 40227fc commit 8a3d87d

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

articles/defender-for-iot/device-builders/quickstart-upload-firmware-using-powershell.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ This quickstart assumes a basic understanding of Defender for IoT Firmware Analy
2525
* Sign in to Azure PowerShell by running the command [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount). Skip this step if you're using Cloud Shell.
2626

2727
* If this is your first use of Defender for IoT Firmware Analysis's Azure PowerShell, install the extension:
28-
```powershell
29-
Find-Module -Name Az.FirmwareAnalysis | Install-Module
30-
```
28+
29+
```powershell
30+
Find-Module -Name Az.FirmwareAnalysis | Install-Module
31+
```
3132
3233
* [Onboard](../../../articles/defender-for-iot/device-builders/tutorial-analyze-firmware.md#onboard-your-subscription-to-use-defender-for-firmware-analysis) your subscription to Defender for IoT Firmware Analysis.
3334
@@ -37,30 +38,30 @@ Find-Module -Name Az.FirmwareAnalysis | Install-Module
3738
3839
1. Create a firmware image to be uploaded. Insert your resource group name, workspace name, and any additional details about your firmware image that you'd like into include in the respective parameters, such as a `Description`, `FileName`, `Vendor`, `Model`, or `Version`.
3940
40-
```powershell
41-
New-AzFirmwareAnalysisFirmware -ResourceGroupName myResourceGroup -WorkspaceName default -Description 'sample description' -FileName file -Vendor vendor -Model model -Version version
42-
```
41+
```powershell
42+
New-AzFirmwareAnalysisFirmware -ResourceGroupName myResourceGroup -WorkspaceName default -Description 'sample description' -FileName file -Vendor vendor -Model model -Version version
43+
```
4344
4445
The output of this command includes a `Name` property, which is your firmware ID. **Save this ID for the next command.**
4546
4647
2. Generate a SAS URL that you'll use in the next step to send your firmware image to Azure Storage. Replace `sampleFirmwareID` with the firmware ID that you saved from the previous step. You can store the SAS URL in a variable for easier access for future commands:
4748
48-
```powershell
49-
$sasUrl = New-AzFirmwareAnalysisWorkspaceUploadUrl -FirmwareId sampleFirmwareID -ResourceGroupName myResourceGroup -WorkspaceName default
50-
```
49+
```powershell
50+
$sasUrl = New-AzFirmwareAnalysisWorkspaceUploadUrl -FirmwareId sampleFirmwareID -ResourceGroupName myResourceGroup -WorkspaceName default
51+
```
5152
5253
3. Use the following script to upload your firmware image to Azure Storage. Replace '`pathToFile`' with the path to your firmware image on your local machine. Wrap the path in quotation marks.
5354
54-
```powershell
55-
$uri = [System.Uri] $sasURL.Url
56-
$storageAccountName = $uri.DnsSafeHost.Split(".")[0]
57-
$container = $uri.LocalPath.Substring(1)
58-
$containerName, $blob = $container -split '/', 2
59-
$sasToken = $uri.Query
60-
$filePath = 'pathToFile'
61-
$storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $sasToken
62-
Set-AzStorageBlobContent -File $filePath -Container $containerName -Context $storageContext -Blob $blob -Force
63-
```
55+
```powershell
56+
$uri = [System.Uri] $sasURL.Url
57+
$storageAccountName = $uri.DnsSafeHost.Split(".")[0]
58+
$container = $uri.LocalPath.Substring(1)
59+
$containerName, $blob = $container -split '/', 2
60+
$sasToken = $uri.Query
61+
$filePath = 'pathToFile'
62+
$storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $sasToken
63+
Set-AzStorageBlobContent -File $filePath -Container $containerName -Context $storageContext -Blob $blob -Force
64+
```
6465
6566
Here's an example workflow from end-to-end of how you could use the Azure PowerShell commands to create and upload a firmware image. Replace the values for the variables set at the beginning to reflect your environment.
6667

articles/defender-for-iot/device-builders/tutorial-analyze-firmware.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ If this is your first interaction with **Firmware analysis**, then you'll need t
4141

4242
1. Sign into the Azure portal and go to Defender for IoT.
4343

44-
:::image type="content" source="media/tutorial-firmware-analysis/defender-portal.png" alt-text="Screenshot of the 'Getting started' page." lightbox="media/tutorial-firmware-analysis/defender-portal.png":::
44+
:::image type="content" source="media/tutorial-firmware-analysis/defender-portal.png" alt-text="Screenshot of the 'Getting started' page." lightbox="media/tutorial-firmware-analysis/defender-portal.png":::
4545

4646
2. Select **Set up a subscription** in the **Get Started** card, or select the **Subscription management** subtab.
4747

48-
:::image type="content" source="media/tutorial-firmware-analysis/subscription-management.png" alt-text="Screenshot of the 'Subscription management' page." lightbox="media/tutorial-firmware-analysis/subscription-management.png":::
48+
:::image type="content" source="media/tutorial-firmware-analysis/subscription-management.png" alt-text="Screenshot of the 'Subscription management' page." lightbox="media/tutorial-firmware-analysis/subscription-management.png":::
4949

5050
3. Select **Onboard a new subscription**
5151

52-
:::image type="content" source="media/tutorial-firmware-analysis/onboard-subscription.png" alt-text="Screenshot of the 'Onboard subscription' pane appearing on the right side of the screen." lightbox="media/tutorial-firmware-analysis/onboard-subscription.png":::
52+
:::image type="content" source="media/tutorial-firmware-analysis/onboard-subscription.png" alt-text="Screenshot of the 'Onboard subscription' pane appearing on the right side of the screen." lightbox="media/tutorial-firmware-analysis/onboard-subscription.png":::
5353

5454
4. In the **Onboard subscription** pane, select a subscription from the drop-down list.
5555
5. Select a resource group from the **Resource group** drop-down or create a new resource group.
5656
6. Select a region to use for storage in the **Location** drop-down.
5757
7. Select **Onboard** to onboard your subscription to Defender for Firmware Analysis.
5858

59-
:::image type="content" source="media/tutorial-firmware-analysis/completed-onboarding.png" alt-text="Screenshot of the 'Onboard subscription' pane when it's completed." lightbox="media/tutorial-firmware-analysis/completed-onboarding.png":::
59+
:::image type="content" source="media/tutorial-firmware-analysis/completed-onboarding.png" alt-text="Screenshot of the 'Onboard subscription' pane when it's completed." lightbox="media/tutorial-firmware-analysis/completed-onboarding.png":::
6060

6161
## Upload a firmware image for analysis
6262

0 commit comments

Comments
 (0)