Skip to content

Commit 8eddcb7

Browse files
authored
Merge pull request MicrosoftDocs#8863 from MicrosoftDocs/chrisda
More Byte[] parameter syntax updates
2 parents c3c4841 + 7052c1a commit 8eddcb7

17 files changed

+29
-40
lines changed

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

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

4141
### Example 1
4242
```powershell
43-
Import-DlpPolicyCollection -FileData ([Byte[]]$(Get-Content -Path " C:\My Documents\DLP Backup.xml " -Encoding Byte -ReadCount 0))
43+
Import-DlpPolicyCollection -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\DLP Backup.xml'))
4444
```
4545

4646
This example imports the DLP policy collection in the file C:\\My Documents\\DLP Backup.xml.

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

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

3535
### Example 1
3636
```powershell
37-
Import-DlpPolicyTemplate -FileData ([Byte[]]$(Get-Content -Path "C:\My Documents\External DLP Policy Template.xml" -Encoding Byte -ReadCount 0))
37+
Import-DlpPolicyTemplate -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\External DLP Policy Template.xml'))
3838
```
3939

4040
This example imports the DLP policy template file C:\\My Documents\\External DLP Policy Template.xml.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ This example imports the certificate from the PKCS #12 file from \\\\FileServer0
8484

8585
### Example 2
8686
```powershell
87-
Import-ExchangeCertificate -FileData ([Byte[]](Get-Content -Path "C:\Certificates\Fabrikam IssuedCert.p7b" -Encoding byte -ReadCount 0))
87+
Import-ExchangeCertificate -FileData ([System.IO.File]::ReadAllBytes('C:\Certificates\Fabrikam IssuedCert.p7b'))
8888
```
8989

9090
This example imports a chain of certificates from the PKCS #7 file C:\\Certificates\\Fabrikam IssuedCert.p7b on the local Exchange server.

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
4343

4444
### Example 1
4545
```powershell
46-
[Byte[]]$Data = Get-Content -Path "C:\JournalRules\ExportedJournalRules.xml" -Encoding Byte -ReadCount 0
47-
Import-JournalRuleCollection -FileData $Data
46+
Import-JournalRuleCollection -FileData ([System.IO.File]::ReadAllBytes('C:\JournalRules\ExportedJournalRules.xml'))
4847
```
4948

50-
This example imports journal rules from the XML file ExportedJournalRules.xml in a two-step process.
51-
52-
The first step retrieves journal rules from the previously exported XML file ExportedJournalRules.xml using the Get-Content cmdlet, and then stores the results in the variable $Data. The second step retrieves data from the variable $Data and imports journal rules to your organization, overwriting existing journal rules.
49+
This example imports journal rules from the XML file named ExportedJournalRules.xml in the C:\\JournalRules folder.
5350

5451
## PARAMETERS
5552

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
4747

4848
### Example 1
4949
```powershell
50-
Import-RecipientDataProperty -Identity "Tony Smith" -SpokenName -FileData ([Byte[]]$(Get-Content -Path "M:\AudioFiles\TonySmith.wma" -Encoding Byte -ReadCount 0))
50+
Import-RecipientDataProperty -Identity "Tony Smith" -SpokenName -FileData ([System.IO.File]::ReadAllBytes('M:\AudioFiles\TonySmith.wma'))
5151
```
5252

5353
This example imports the audio file for Tony Smith's spoken name.
5454

5555
### Example 2
5656
```powershell
57-
Import-RecipientDataProperty -Identity Ayla -Picture -FileData ([Byte[]]$(Get-Content -Path "M:\Employee Photos\AylaKol.jpg" -Encoding Byte -ReadCount 0))
57+
Import-RecipientDataProperty -Identity Ayla -Picture -FileData ([System.IO.File]::ReadAllBytes('M:\Employee Photos\AylaKol.jpg'))
5858
```
5959

6060
This example imports the picture file for Ayla Kol.

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
4242

4343
### Example 1
4444
```powershell
45-
[Byte[]]$Data = Get-Content -Path "C:\TransportRules\ExportedRules.xml" -Encoding Byte -ReadCount 0
46-
Import-TransportRuleCollection -FileData $Data
45+
Import-TransportRuleCollection -FileData ([System.IO.File]::ReadAllBytes('C:\TransportRules\ExportedRules.xml'))
4746
```
4847

4948
This example imports a transport rule collection from the XML file named ExportedRules.xml in the C:\\TransportRules folder.
5049

51-
**Note**: In PowerShell 6.0 or later, replace `-Encoding Byte` with `-AsByteStream`.
52-
5350
## PARAMETERS
5451

5552
### -Identity

exchange/exchange-ps/exchange/Import-UMPrompt.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,24 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
6767

6868
### Example 1
6969
```powershell
70-
[byte[]]$c = Get-content -Path "d:\UMPrompts\welcomegreeting.wav" -Encoding Byte -ReadCount 0
71-
Import-UMPrompt -UMDialPlan MyUMDialPlan -PromptFileName "welcomegreeting.wav" -PromptFileData $c
70+
Import-UMPrompt -UMDialPlan MyUMDialPlan -PromptFileName "welcomegreeting.wav" -PromptFileData ([System.IO.File]::ReadAllBytes('D:\UMPrompts\welcomegreeting.wav'))
7271
```
7372

74-
This example imports the welcome greeting file welcomegreeting.wav from d:\\UMPrompts into the UM dial plan MyUMDialPlan.
73+
This example imports the welcome greeting file welcomegreeting.wav from D:\\UMPrompts into the UM dial plan MyUMDialPlan.
7574

7675
### Example 2
7776
```powershell
78-
[byte[]]$c = Get-content -Path "d:\UMPrompts\welcomegreeting.wav" -Encoding Byte -ReadCount 0
79-
Import-UMPrompt -UMAutoAttendant MyUMAutoAttendant -PromptFileName "welcomegreeting.wav" -PromptFileData $c
77+
Import-UMPrompt -UMAutoAttendant MyUMAutoAttendant -PromptFileName "welcomegreeting.wav" -PromptFileData ([System.IO.File]::ReadAllBytes('D:\UMPrompts\welcomegreeting.wav'))
8078
```
8179

82-
This example imports the welcome greeting file welcomegreeting.wav from d:\\UMPrompts into the UM auto attendant MyUMAutoAttendant.
80+
This example imports the welcome greeting file welcomegreeting.wav from D:\\UMPrompts into the UM auto attendant MyUMAutoAttendant.
8381

8482
### Example 3
8583
```powershell
86-
[byte[]]$c = Get-content -Path "d:\UMPrompts\AfterHoursWelcomeGreeting.wav" -Encoding Byte -ReadCount 0
87-
Import-UMPrompt -UMAutoAttendant MyUMAutoAttendant -PromptFileName "AfterHoursWelcomeGreeting.wav" -PromptFileData $c
84+
Import-UMPrompt -UMAutoAttendant MyUMAutoAttendant -PromptFileName "AfterHoursWelcomeGreeting.wav" -PromptFileData ([System.IO.File]::ReadAllBytes('D:\UMPrompts\AfterHoursWelcomeGreeting.wav'))
8885
```
8986

90-
This example imports the welcome greeting file AfterHoursWelcomeGreeting.wav from d:\\UMPrompts into the UM auto attendant MyUMAutoAttendant.
87+
This example imports the welcome greeting file AfterHoursWelcomeGreeting.wav from D:\\UMPrompts into the UM auto attendant MyUMAutoAttendant.
9188

9289
## PARAMETERS
9390

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

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

3838
### Example 1
3939
```powershell
40-
New-ClassificationRuleCollection -FileData ([Byte[]]$(Get-Content -Path "C:\My Documents\External Classification Rule Collection.xml" -Encoding Byte -ReadCount 0))
40+
New-ClassificationRuleCollection -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\External Classification Rule Collection.xml'))
4141
```
4242

4343
This example imports the classification rule collection file C:\\My Documents\\External Classification Rule Collection.xml.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ To use this cmdlet in Security & Compliance Center PowerShell, you need to be as
3636

3737
### Example 1
3838
```powershell
39-
$edmSchemaXml = Get-Content "C:\My Documents\edm.xml" -Encoding Byte -ReadCount 0
40-
New-DlpEdmSchema -FileData $edmSchemaXml -Confirm:$true
39+
New-DlpEdmSchema -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\edm.xml')) -Confirm:$true
4140
```
4241

43-
This example creates a new DLP EDM schema. The first command reads the schema in the XML file to a variable, and the second command uses that information to create the DLP EDM schema.
42+
This example creates a new DLP EDM schema using the file named edm.xml in the folder C:\\My Documents.
4443

4544
## PARAMETERS
4645

exchange/exchange-ps/exchange/New-DlpSensitiveInformationType.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ To use this cmdlet in Security & Compliance Center PowerShell, you need to be as
3737

3838
### Example 1
3939
```powershell
40-
$Employee_Template = Get-Content "C:\My Documents\Contoso Employee Template.docx" -Encoding byte -ReadCount 0
40+
$Employee_Template = [System.IO.File]::ReadAllBytes('C:\My Documents\Contoso Employee Template.docx')
4141
$Employee_Fingerprint = New-DlpFingerprint -FileData $Employee_Template -Description "Contoso Employee Template"
42-
$Customer_Template = Get-Content "D:\Data\Contoso Customer Template.docx" -Encoding byte
42+
$Customer_Template = [System.IO.File]::ReadAllBytes('D:\Data\Contoso Customer Template.docx')
4343
$Customer_Fingerprint = New-DlpFingerprint -FileData $Customer_Template -Description "Contoso Customer Template"
4444
New-DlpSensitiveInformationType -Name "Contoso Employee-Customer Confidential" -Fingerprints $Employee_Fingerprint[0],$Customer_Fingerprint[0] -Description "Message contains Contoso employee or customer information."
4545
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To use this cmdlet in Security & Compliance Center PowerShell, you need to be as
3838
### Example 1
3939
```powershell
4040
41-
New-DlpSensitiveInformationTypeRulePackage -FileData ([Byte[]]$(Get-Content -Path "C:\My Documents\External Sensitive Info Type Rule Collection.xml" -Encoding Byte -ReadCount 0))
41+
New-DlpSensitiveInformationTypeRulePackage -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\External Sensitive Info Type Rule Collection.xml'))
4242
```
4343

4444
This example imports the sensitive information type rule package C:\\My Documents\\External Sensitive Info Type Rule Collection.xml.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This example creates the Edge Subscription file. It should be run on your Edge T
5050

5151
### Example 2
5252
```powershell
53-
[byte[]]$Temp = Get-Content -Path "C:\EdgeServerSubscription.xml" -Encoding Byte -ReadCount 0
53+
$Temp = [System.IO.File]::ReadAllBytes('C:\EdgeServerSubscription.xml')
5454
New-EdgeSubscription -FileData $Temp -Site "Default-First-Site-Name"
5555
```
5656

@@ -60,7 +60,7 @@ The first command reads the data from the Edge Subscription file and stores it i
6060

6161
### Example 3
6262
```powershell
63-
New-EdgeSubscription -FileData ([byte[]]$(Get-Content -Path "C:\EdgeServerSubscription.xml" -Encoding Byte -ReadCount 0)) -Site "Default-First-Site-Name"
63+
New-EdgeSubscription -FileData ([System.IO.File]::ReadAllBytes('C:\EdgeServerSubscription.xml')) -Site "Default-First-Site-Name"
6464
```
6565

6666
This example also imports the Edge Subscription file generated in Example 1 to the Active Directory site Default-First-Site-Name; however, the end result is accomplished using one command. You must run this command on the Mailbox server.

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

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

3838
### Example 1
3939
```powershell
40-
Set-ClassificationRuleCollection -FileData ([Byte[]]$(Get-Content -Path "C:\My Documents\External Classification Rule Collection.xml" -Encoding Byte -ReadCount 0))
40+
Set-ClassificationRuleCollection -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\External Classification Rule Collection.xml'))
4141
```
4242

4343
This example imports the classification rule collection file C:\\My Documents\\External Classification Rule Collection.xml.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ To use this cmdlet in Security & Compliance Center PowerShell, you need to be as
3636

3737
### Example 1
3838
```powershell
39-
$edmSchemaXml = Get-Content "C:\My Documents\edm.xml" -Encoding Byte -ReadCount 0
40-
Set-DlpEdmSchema -FileData $edmSchemaXml -Confirm:$true
39+
Set-DlpEdmSchema -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\edm.xml')) -Confirm:$true
4140
```
4241

43-
This example modifies a DLP EDM schema. The first command reads the schema in the XML file to a variable, and the second command uses that information to modify the DLP EDM schema.
42+
This example modifies a DLP EDM schema using the edm.xml file in the C:\\My Documents folder.
4443

4544
## PARAMETERS
4645

exchange/exchange-ps/exchange/Set-DlpSensitiveInformationType.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This example removes the existing Spanish translation from the sensitive informa
5454

5555
### Example 3
5656
```powershell
57-
$Benefits_Template = Get-Content "C:\My Documents\Contoso Benefits Template.docx" -Encoding byte -ReadCount 0
57+
$Benefits_Template = [System.IO.File]::ReadAllBytes('C:\My Documents\Contoso Benefits Template.docx')
5858
$Benefits_Fingerprint = New-DlpFingerprint -FileData $Benefits_Template -Description "Contoso Benefits Template"
5959
$Contoso_Confidential = Get-DlpSensitiveInformationType "Contoso Confidential"
6060
$Array = [System.Collections.ArrayList]($Contoso_Confidential.Fingerprints)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To use this cmdlet in Security & Compliance Center PowerShell, you need to be as
3636

3737
### Example 1
3838
```powershell
39-
Set-DlpSensitiveInformationTypeRulePackage -FileData ([Byte[]]$(Get-Content -Path "C:\My Documents\External Sensitive Info Type Rule Collection.xml" -Encoding Byte -ReadCount 0))
39+
Set-DlpSensitiveInformationTypeRulePackage -FileData ([System.IO.File]::ReadAllBytes('C:\My Documents\External Sensitive Info Type Rule Collection.xml'))
4040
```
4141

4242
This example imports the sensitive information type rule package C:\\My Documents\\External Sensitive Info Type Rule Collection.xml.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ You need to be assigned permissions before you can run this cmdlet. Although thi
3737

3838
### Example 1
3939
```powershell
40-
$content = Test-TextExtraction -FileData (Get-Content -Path '.\financial data.msg' -Encoding byte -ReadCount 0)
40+
$content = Test-TextExtraction -FileData ([System.IO.File]::ReadAllBytes('.\financial data.msg'))
4141
$content.ExtractedResults
4242
```
4343

4444
This example returns the text that's extracted from the email "financial data.msg"
4545

4646
### Example 2
4747
```powershell
48-
$content = Test-TextExtraction -FileData (Get-Content -Path '.\financial data.msg' -Encoding byte -ReadCount 0)
48+
$content = Test-TextExtraction -FileData ([System.IO.File]::ReadAllBytes('.\financial data.msg'))
4949
Test-DataClassification -TestTextExtractionResults $content.ExtractedResults
5050
```
5151

0 commit comments

Comments
 (0)