Skip to content

Commit ff037c7

Browse files
committed
Updates to Byte[] syntax
Per Issue MicrosoftDocs#8839
1 parent c02e894 commit ff037c7

20 files changed

+24
-25
lines changed

exchange/exchange-ps/exchange/Import-DlpPolicyCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Accept wildcard characters: False
6666
### -FileData
6767
The FileData parameter specifies the DLP policy collection file you want to import.
6868
69-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
69+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
7070

7171
```yaml
7272
Type: Byte[]

exchange/exchange-ps/exchange/Import-DlpPolicyTemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This example imports the DLP policy template file C:\\My Documents\\External DLP
4444
### -FileData
4545
The FileData parameter specifies the DLP policy template file you want to import.
4646

47-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
47+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
4848

4949
```yaml
5050
Type: Byte[]

exchange/exchange-ps/exchange/Import-ExchangeCertificate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This example imports a chain of certificates from the PKCS #7 file C:\\Certifica
9494
### -FileData
9595
The FileData parameter specifies the contents of the certificate file that you want to import. Typically, you use this parameter for PKCS #7 text certificate files that have .p7b or .p7c filename extensions. These text files contain the text: -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- or -----BEGIN PKCS7----- and -----END PKCS7-----.
9696

97-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
97+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
9898

9999
You can use a local path if the certificate file is located on the Exchange server where you're running the command, and this is the same server where you want to install the certificate. Otherwise, use a UNC path (`\\Server\Share`).
100100

exchange/exchange-ps/exchange/Import-JournalRuleCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Accept wildcard characters: False
7272
### -FileData
7373
The FileData parameter specifies the variable name that contains the content of the XML file.
7474
75-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
75+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
7676

7777
```yaml
7878
Type: Byte[]

exchange/exchange-ps/exchange/Import-RMSTrustedPublishingDomain.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
7676

7777
### Example 1
7878
```powershell
79-
Import-RMSTrustedPublishingDomain -Name "Contoso TPD" -FileData $([byte[]](Get-Content -Encoding byte -Path "C:\My Documents\Contoso.xml" -ReadCount 0)) -Password (ConvertTo-SecureString -String 'Pa$$word1' -AstPlainText -Force)-ExtranetLicensingUrl https://rms.contoso.com/_wmcs/licensing -IntranetLicensingUrl https://RMS01/_wmcs/licensing
79+
$data = [System.IO.File]::ReadAllBytes('C:\My Documents\Contoso.xml')
80+
Import-RMSTrustedPublishingDomain -Name "Contoso TPD" -FileData $data -Password (ConvertTo-SecureString -String 'Pa$$word1' -AstPlainText -Force)-ExtranetLicensingUrl https://rms.contoso.com/_wmcs/licensing -IntranetLicensingUrl https://RMS01/_wmcs/licensing
8081
```
8182

8283
This example imports a TPD from an AD RMS server into a cloud-based organization. The TPD uses the following values:
@@ -110,7 +111,7 @@ Accept wildcard characters: False
110111
### -FileData
111112
The FileData parameter specifies the XML file you want to import. The XML file contains the TPD you exported from the on-premises AD RMS server.
112113
113-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
114+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
114115

115116
```yaml
116117
Type: Byte[]

exchange/exchange-ps/exchange/Import-RecipientDataProperty.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Accept wildcard characters: False
8585
### -FileData
8686
The FileData parameter specifies the location and file name of the picture or audio file.
8787
88-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
88+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
8989

9090
```yaml
9191
Type: Byte[]

exchange/exchange-ps/exchange/Import-TransportRuleCollection.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ Accept wildcard characters: False
7777
### -FileData
7878
The FileData parameter specifies the variable name that contains the content of the XML file.
7979
80-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `(Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0)`.
81-
82-
**Note**: In PowerShell 6.0 or later, replace `-Encoding Byte` with `-AsByteStream`.
80+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
8381

8482
```yaml
8583
Type: Byte[]

exchange/exchange-ps/exchange/New-App.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
108108

109109
### Example 1
110110
```powershell
111-
New-App -FileData ([Byte[]](Get-Content -Encoding Byte -Path "C:\Apps\FinanceTestApp.xml" -ReadCount 0))
111+
$data = [System.IO.File]::ReadAllBytes('C:\Apps\FinanceTestApp.xml')
112+
New-App -FileData $data -ReadCount 0))
112113
```
113114

114115
This example installs the Finance Test app manifest file that has been copied to the local hard disk.
@@ -255,7 +256,7 @@ Accept wildcard characters: False
255256
### -FileData
256257
The FileData parameter specifies the location of the app manifest file. You need to specify only one source location for the app manifest file. You can specify the app manifest file by using the MarketplaceServicesUrl, Url, or FileData parameter.
257258

258-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
259+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
259260

260261
```yaml
261262
Type: Byte[]

exchange/exchange-ps/exchange/New-ClassificationRuleCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This example imports the classification rule collection file C:\\My Documents\\E
4747
### -FileData
4848
The FileData parameter specifies the classification rule collection file you want to import.
4949

50-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
50+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5151

5252
```yaml
5353
Type: Byte[]

exchange/exchange-ps/exchange/New-DlpEdmSchema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This example creates a new DLP EDM schema. The first command reads the schema in
4747
### -FileData
4848
The FileData parameter specifies the DLP EDM schema that you want to import.
4949

50-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
50+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5151

5252
```yaml
5353
Type: Byte[]

exchange/exchange-ps/exchange/New-DlpPolicy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Accept wildcard characters: False
195195
### -TemplateData
196196
The TemplateData parameter specifies an external DLP policy template file from which you can create a new DLP policy. You can't use the TemplateData and Template parameters in the same command.
197197

198-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
198+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
199199

200200
```yaml
201201
Type: Byte[]

exchange/exchange-ps/exchange/New-DlpSensitiveInformationTypeRulePackage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This example imports the sensitive information type rule package C:\\My Document
4848
### -FileData
4949
The FileData parameter specifies the sensitive information type rule package that you want to import.
5050

51-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
51+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5252

5353
```yaml
5454
Type: Byte[]

exchange/exchange-ps/exchange/New-EdgeSubscription.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ Accept wildcard characters: False
159159
### -FileData
160160
The FileData parameter specifies the byte-encoded data object that contains the Edge Subscription file information.
161161

162-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
163-
162+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
164163
You can only use this parameter when you're running this command on a Mailbox server.
165164

166165
```yaml

exchange/exchange-ps/exchange/New-PublicFolderMigrationRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Accept wildcard characters: False
188188
### -CSVData
189189
The CSVData parameter specifies the mapping file output generated by the PublicFoldertoMailboxMapGenerator.ps1 script. Use this parameter for local migrations.
190190

191-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
191+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
192192

193193
You can't use this parameter with the CSVStream parameter, but you need to use it if you don't use CSVStream parameter.
194194

exchange/exchange-ps/exchange/Set-ClassificationRuleCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This example imports the classification rule collection file C:\\My Documents\\E
4747
### -FileData
4848
The FileData parameter specifies the classification rule collection file you want to import.
4949

50-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
50+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5151

5252
```yaml
5353
Type: Byte[]

exchange/exchange-ps/exchange/Set-DlpEdmSchema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This example modifies a DLP EDM schema. The first command reads the schema in th
4747
### -FileData
4848
The FileData parameter specifies the DLP EDM schema that you want to import.
4949

50-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
50+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5151

5252
```yaml
5353
Type: Byte[]

exchange/exchange-ps/exchange/Set-DlpSensitiveInformationTypeRulePackage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This example imports the sensitive information type rule package C:\\My Document
4646
### -FileData
4747
The FileData parameter specifies the sensitive information type rule package that you want to import.
4848

49-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
49+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
5050

5151
```yaml
5252
Type: Byte[]

exchange/exchange-ps/exchange/Set-SmimeConfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ Accept wildcard characters: False
596596
### -SMIMECertificateIssuingCA
597597
The SMIMECertificateIssuingCA parameter specifies the serialized certificate store (SST) that contains the Certificate Authority (CA) signing and intermediate certificate information.
598598

599-
You need to read the file to a byte-encoded object using the Get-Content cmdlet. For example: `-SMIMECertificateIssuingCA $([byte[]](Get-Content -Encoding byte -Path "C:\Temp\CACertificateSerializedStore.sst" -ReadCount 0)`.
599+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
600600

601601
Each certificate is checked, and if any certificates are expired, the operation will fail.
602602

exchange/exchange-ps/exchange/Test-Message.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
133133

134134
### Example 1
135135
```powershell
136-
$data = [System.IO.File]::ReadAllBytes('C:\data\test.eml)
136+
$data = [System.IO.File]::ReadAllBytes('C:\data\test.eml')
137137
Test-Message -MessageFileData $data -Sender [email protected] -Recipients [email protected] -SendReportTo [email protected] -TransportRules -UnifiedDlpRules
138138
```
139139

exchange/exchange-ps/exchange/Test-TextExtraction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This example extracts the text from the email "financial data.msg" and returns t
5656
### -FileData
5757
The FileData parameter specifies the name and path of the file from which text should be extracted.
5858

59-
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `(Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0)`.
59+
A valid value for this parameter requires you to read the file to a byte-encoded object. For example, `$data = [System.IO.File]::ReadAllBytes('<Path>\<FileName>')`.
6060

6161
```yaml
6262
Type: Byte[]

0 commit comments

Comments
 (0)