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