Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".
To run Windows Defender Firewall with Advanced Security
Run the following in an Administrative Powershell window ... to review possible rules:
& "C:\WINDOWS\system32\mmc.exe" "C:\WINDOWS\system32\wf.msc"
To allow access for File/Print only on private network
Run the following in an Administrative Powershell window.
# Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/968310/336668]
$ruleDisplayNames = "File and Printer Sharing (Echo Request - ICMPv4-In)", `
"File and Printer Sharing (Echo Request - ICMPv6-In)", `
"File and Printer Sharing (LLMNR-UDP-In)", `
"File and Printer Sharing (NB-Datagram-In)", `
"File and Printer Sharing (NB-Name-In)", `
"File and Printer Sharing (SMB-In)", `
"File and Printer Sharing (Spooler Service - RPC)", `
"File and Printer Sharing (Spooler Service - RPC-EPMAP)", `
"File and Printer Sharing (NB-Session-In)"
$rules = Get-NetFirewallRule | Where {$ruleDisplayNames -contains $_.DisplayName -and $_.Profile -ne "Domain"}
# The default rules have the non-Domain rule apply for both Public and
# Private. This updates the rule to be Private only
$rules | Set-NetFirewallRule -Profile Private
# Enable the rule -- i.e. grant the eexception (allow through firewall)
$rules | Enable-NetFirewallRule