docs: Update Comment Help
This commit is contained in:
@@ -90,6 +90,7 @@
|
|||||||
FailureReason: Non-Compliant Accounts: 2
|
FailureReason: Non-Compliant Accounts: 2
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com" -SkipRecommendation '1.1.3', '2.1.1'
|
PS> Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com" -SkipRecommendation '1.1.3', '2.1.1'
|
||||||
|
|
||||||
Performs an audit while excluding specific recommendations 1.1.3 and 2.1.1.
|
Performs an audit while excluding specific recommendations 1.1.3 and 2.1.1.
|
||||||
Output:
|
Output:
|
||||||
|
|
||||||
|
@@ -22,28 +22,21 @@ function Remove-RowsWithEmptyCSVStatus {
|
|||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[string]$WorksheetName
|
[string]$WorksheetName
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import the Excel file
|
# Import the Excel file
|
||||||
$ExcelData = Import-Excel -Path $FilePath -WorksheetName $WorksheetName
|
$ExcelData = Import-Excel -Path $FilePath -WorksheetName $WorksheetName
|
||||||
|
|
||||||
# Check if CSV_Status column exists
|
# Check if CSV_Status column exists
|
||||||
if (-not $ExcelData.PSObject.Properties.Match("CSV_Status")) {
|
if (-not $ExcelData.PSObject.Properties.Match("CSV_Status")) {
|
||||||
throw "CSV_Status column not found in the worksheet."
|
throw "CSV_Status column not found in the worksheet."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Filter rows where CSV_Status is not empty
|
# Filter rows where CSV_Status is not empty
|
||||||
$FilteredData = $ExcelData | Where-Object { $null -ne $_.CSV_Status -and $_.CSV_Status -ne '' }
|
$FilteredData = $ExcelData | Where-Object { $null -ne $_.CSV_Status -and $_.CSV_Status -ne '' }
|
||||||
|
|
||||||
# Get the original file name and directory
|
# Get the original file name and directory
|
||||||
$OriginalFileName = [System.IO.Path]::GetFileNameWithoutExtension($FilePath)
|
$OriginalFileName = [System.IO.Path]::GetFileNameWithoutExtension($FilePath)
|
||||||
$Directory = [System.IO.Path]::GetDirectoryName($FilePath)
|
$Directory = [System.IO.Path]::GetDirectoryName($FilePath)
|
||||||
|
|
||||||
# Create a new file name for the filtered data
|
# Create a new file name for the filtered data
|
||||||
$NewFileName = "$OriginalFileName-Filtered.xlsx"
|
$NewFileName = "$OriginalFileName-Filtered.xlsx"
|
||||||
$NewFilePath = Join-Path -Path $Directory -ChildPath $NewFileName
|
$NewFilePath = Join-Path -Path $Directory -ChildPath $NewFileName
|
||||||
|
|
||||||
# Export the filtered data to a new Excel file
|
# Export the filtered data to a new Excel file
|
||||||
$FilteredData | Export-Excel -Path $NewFilePath -WorksheetName $WorksheetName -Show
|
$FilteredData | Export-Excel -Path $NewFilePath -WorksheetName $WorksheetName -Show
|
||||||
|
|
||||||
Write-Output "Filtered Excel file created at $NewFilePath"
|
Write-Output "Filtered Excel file created at $NewFilePath"
|
||||||
}
|
}
|
Reference in New Issue
Block a user