Create directories with supplied security through the modern API
ProprietaryOpt-in Windows port of resolved Directory.CreateDirectory(string, DirectorySecurity) calls through a private helper. Preserve original argument evaluation order and the same ACL object; null security falls back to ordinary directory creation. Use FileSystemAclExtensions.CreateDirectory without a create-then-set sequence. Plan the helper consistently across conditional snapshots; leave shared calls outside conditional regions unchanged. Skip unsupported owners, named/commented calls and deferred/expression-bodied contexts. Standalone, not in version composites; Framework CAS/path policy and native failure details are not emulated.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseDirectorySecurityForDirectoryCreationmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net6. UseDirectorySecurityForDirectoryCreationInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.