Skip to content

Commit

Permalink
Formating cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficialEsco committed Apr 20, 2024
1 parent 1c440bb commit 9a39225
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function Invoke-CIPPStandardMalwareFilterPolicy {
#>

param($Tenant, $Settings)
$PolicyName = "Default Malware Policy"
$PolicyName = 'Default Malware Policy'

$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-MalwareFilterPolicy' |
Where-Object -Property Name -eq $PolicyName |
Where-Object -Property Name -EQ $PolicyName |
Select-Object Name, EnableFileFilter, FileTypeAction, ZapEnabled, QuarantineTag, EnableInternalSenderAdminNotifications, InternalSenderAdminAddress, EnableExternalSenderAdminNotifications, ExternalSenderAdminAddress

$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and
Expand All @@ -27,23 +27,23 @@ function Invoke-CIPPStandardMalwareFilterPolicy {
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Malware Filter Policy already correctly configured' -sev Info
} else {
$cmdparams = @{
EnableFileFilter = $true
FileTypeAction = $Settings.FileTypeAction
ZapEnabled = $true
QuarantineTag = $Settings.QuarantineTag
EnableInternalSenderAdminNotifications = $Settings.EnableInternalSenderAdminNotifications
InternalSenderAdminAddress = $Settings.InternalSenderAdminAddress
EnableExternalSenderAdminNotifications = $Settings.EnableExternalSenderAdminNotifications
ExternalSenderAdminAddress = $Settings.ExternalSenderAdminAddress
EnableFileFilter = $true
FileTypeAction = $Settings.FileTypeAction
ZapEnabled = $true
QuarantineTag = $Settings.QuarantineTag
EnableInternalSenderAdminNotifications = $Settings.EnableInternalSenderAdminNotifications
InternalSenderAdminAddress = $Settings.InternalSenderAdminAddress
EnableExternalSenderAdminNotifications = $Settings.EnableExternalSenderAdminNotifications
ExternalSenderAdminAddress = $Settings.ExternalSenderAdminAddress
}

try {
if ($CurrentState.Name -eq $PolicyName) {
$cmdparams.Add("Identity", $PolicyName)
$cmdparams.Add('Identity', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-MalwareFilterPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Updated Malware Filter Policy' -sev Info
} else {
$cmdparams.Add("Name", $PolicyName)
$cmdparams.Add('Name', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'New-MalwareFilterPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Created Malware Filter Policy' -sev Info
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function Invoke-CIPPStandardSafeAttachmentPolicy {
#>

param($Tenant, $Settings)
$PolicyName = "Default Safe Attachment Policy"
$PolicyName = 'Default Safe Attachment Policy'

$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-SafeAttachmentPolicy' |
Where-Object -Property Name -eq $PolicyName |
Where-Object -Property Name -EQ $PolicyName |
Select-Object Name, Enable, Action, QuarantineTag, Redirect, RedirectAddress

$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and
Expand All @@ -23,19 +23,19 @@ function Invoke-CIPPStandardSafeAttachmentPolicy {
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Safe Attachment Policy already correctly configured' -sev Info
} else {
$cmdparams = @{
Enable = $true
QuarantineTag = $Settings.QuarantineTag
Redirect = $Settings.Redirect
Enable = $true
QuarantineTag = $Settings.QuarantineTag
Redirect = $Settings.Redirect
RedirectAddress = $Settings.RedirectAddress
}

try {
if ($CurrentState.Name -eq $PolicyName) {
$cmdparams.Add("Identity", $PolicyName)
$cmdparams.Add('Identity', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-SafeAttachmentPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Updated Safe Attachment Policy' -sev Info
} else {
$cmdparams.Add("Name", $PolicyName)
$cmdparams.Add('Name', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'New-SafeAttachmentPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Created Safe Attachment Policy' -sev Info
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function Invoke-CIPPStandardSafeLinksPolicy {
#>

param($Tenant, $Settings)
$PolicyName = "Default SafeLinks Policy"
$PolicyName = 'Default SafeLinks Policy'

$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-SafeLinksPolicy' |
Where-Object -Property Name -eq $PolicyName |
Where-Object -Property Name -EQ $PolicyName |
Select-Object Name, EnableSafeLinksForEmail, EnableSafeLinksForTeams, EnableSafeLinksForOffice, TrackClicks, AllowClickThrough, ScanUrls, EnableForInternalSenders, DeliverMessageAfterScan, DisableUrlRewrite, EnableOrganizationBranding

$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and
Expand All @@ -29,25 +29,25 @@ function Invoke-CIPPStandardSafeLinksPolicy {
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'SafeLink Policy already correctly configured' -sev Info
} else {
$cmdparams = @{
EnableSafeLinksForEmail = $true
EnableSafeLinksForTeams = $true
EnableSafeLinksForOffice = $true
TrackClicks = $true
ScanUrls = $true
EnableForInternalSenders = $true
DeliverMessageAfterScan = $true
AllowClickThrough = $Settings.AllowClickThrough
DisableUrlRewrite = $Settings.DisableUrlRewrite
EnableOrganizationBranding = $Settings.EnableOrganizationBranding
EnableSafeLinksForEmail = $true
EnableSafeLinksForTeams = $true
EnableSafeLinksForOffice = $true
TrackClicks = $true
ScanUrls = $true
EnableForInternalSenders = $true
DeliverMessageAfterScan = $true
AllowClickThrough = $Settings.AllowClickThrough
DisableUrlRewrite = $Settings.DisableUrlRewrite
EnableOrganizationBranding = $Settings.EnableOrganizationBranding
}

try {
if ($CurrentState.Name -eq $PolicyName) {
$cmdparams.Add("Identity", $PolicyName)
$cmdparams.Add('Identity', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-SafeLinksPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Updated SafeLink Policy' -sev Info
} else {
$cmdparams.Add("Name", $PolicyName)
$cmdparams.Add('Name', $PolicyName)
New-ExoRequest -tenantid $Tenant -cmdlet 'New-SafeLinksPolicy' -cmdparams $cmdparams
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Created SafeLink Policy' -sev Info
}
Expand Down

0 comments on commit 9a39225

Please sign in to comment.