Skip to content

Commit 7155ad2

Browse files
authored
Merge pull request #91712 from SebastianClaesson/patch-1
Adding Pwsh commands
2 parents 8736109 + 5c27bfd commit 7155ad2

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

articles/storage/common/storage-use-azcopy-v10.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: AzCopy is a command-line utility that you can use to copy data to,
44
author: normesta
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 09/23/2022
7+
ms.date: 09/29/2022
88
ms.author: normesta
99
ms.subservice: common
1010
ms.custom: contperf-fy21q2
@@ -147,20 +147,34 @@ To obtain the link, run this command:
147147

148148
| Operating system | Command |
149149
|--------|-----------|
150-
| **Linux** | `curl -s -D- https://aka.ms/downloadazcopy-v10-linux | grep ^Location` |
151-
| **Windows (PowerShell Core 7)** | `(Invoke-WebRequest https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction silentlycontinue -SkipHttpErrorCheck).headers.location[0]` |
152-
| **Windows (PowerShell 5.1)** | `(Invoke-WebRequest https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction silentlycontinue ).headers.location` |
153-
150+
| **Linux** | `curl -s -D- https://aka.ms/downloadazcopy-v10-linux \| grep ^Location` |
151+
| **Windows PowerShell** | `(Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue).headers.location` |
152+
| **PowerShell 6.1+** | `(Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck).headers.location` |
154153

155154
> [!NOTE]
156155
> For Linux, `--strip-components=1` on the `tar` command removes the top-level folder that contains the version name, and instead extracts the binary directly into the current folder. This allows the script to be updated with a new version of `azcopy` by only updating the `wget` URL.
157156
158157
The URL appears in the output of this command. Your script can then download AzCopy by using that URL.
159158

160-
| Operating system | Command |
161-
|--------|-----------|
162-
| **Linux** | `wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1` |
163-
| **Windows** | `Invoke-WebRequest https://azcopyvnext.azureedge.net/release20190517/azcopy_windows_amd64_10.1.2.zip -OutFile azcopyv10.zip <<Unzip here>>` |
159+
**Linux**
160+
```bash
161+
wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1
162+
```
163+
**Windows PowerShell**
164+
```PowerShell
165+
Invoke-WebRequest -Uri 'https://azcopyvnext.azureedge.net/release20220315/azcopy_windows_amd64_10.14.1.zip' -OutFile 'azcopyv10.zip'
166+
Expand-archive -Path '.\azcopyv10.zip' -Destinationpath '.\'
167+
$AzCopy = (Get-ChildItem -path '.\' -Recurse -File -Filter 'azcopy.exe').FullName
168+
# Invoke AzCopy
169+
& $AzCopy
170+
```
171+
**PowerShell 6.1+**
172+
```PowerShell
173+
Invoke-WebRequest -Uri 'https://azcopyvnext.azureedge.net/release20220315/azcopy_windows_amd64_10.14.1.zip' -OutFile 'azcopyv10.zip'
174+
$AzCopy = (Expand-archive -Path '.\azcopyv10.zip' -Destinationpath '.\' -PassThru | where-object {$_.Name -eq 'azcopy.exe'}).FullName
175+
# Invoke AzCopy
176+
& $AzCopy
177+
```
164178

165179
#### Escape special characters in SAS tokens
166180

0 commit comments

Comments
 (0)