You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: file-server-audit/FolderAclAudit.ps1
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
# PSScriptAnalyzer suppressions for interactive script requirements
2
+
# Suppress PSAvoidUsingWriteHost - Write-Host is needed for interactive prompts and colored output
3
+
# Suppress PSUseApprovedVerbs - Process-Folder is an internal helper function
4
+
# Suppress PSAvoidOverwritingBuiltInCmdlets - Write-Log is a common pattern and our implementation is appropriate
5
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost','', Justification='Write-Host is required for interactive prompts and colored output in this user-facing script')]
6
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseApprovedVerbs','', Justification='Process-Folder is an internal helper function with clear naming')]
7
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidOverwritingBuiltInCmdlets','', Justification='Write-Log is a common pattern and our implementation is appropriate for this script')]
1
8
param(
2
9
[Parameter(Mandatory=$false,
3
10
HelpMessage="Root path to audit (e.g. \\fileserver\\share or C:\\Data)")]
@@ -25,12 +32,12 @@ if ([string]::IsNullOrWhiteSpace($RootPath)) {
25
32
Write-Host"Please provide the required information:"-ForegroundColor Yellow
26
33
Write-Host""
27
34
$RootPath=Read-Host"Enter root path to audit (e.g. \\fileserver\share or C:\Data)"
28
-
35
+
29
36
if ([string]::IsNullOrWhiteSpace($RootPath)) {
30
37
Write-Error"Root path is required. Script cannot continue without a valid path."
31
38
exit1
32
39
}
33
-
40
+
34
41
Write-Host"Root path set to: $RootPath"-ForegroundColor Green
35
42
}
36
43
@@ -44,7 +51,7 @@ if ([string]::IsNullOrWhiteSpace($MaxDepth)) {
44
51
Write-Host" - Enter any positive number for specific depth limit"-ForegroundColor Gray
45
52
Write-Host""
46
53
$MaxDepth=Read-Host"Enter Max Depth (or press ENTER for unlimited)"
47
-
54
+
48
55
if ([string]::IsNullOrWhiteSpace($MaxDepth)) {
49
56
Write-Host"Max depth set to: Unlimited (all subfolders)"-ForegroundColor Green
0 commit comments