Skip to content

Bug: Undeclared parameters -LogPath and -EnableDebugMode in New-ShareAndDFS.ps1 #1

@leonardokr

Description

@leonardokr

Description

New-ShareAndDFS.ps1 documents -LogPath and -EnableDebugMode in both the comment-based help block and the NetworkShares/README.md, but neither parameter is declared in the param() block.

This means any usage shown in the README (e.g., .\New-ShareAndDFS.ps1 -EnableDebugMode) will fail at runtime.

Steps to Reproduce

.\Scripts\NetworkShares\New-ShareAndDFS.ps1 -BasePath "C:\Shares" -DomainNamespace "corp.local" -ServerName "FS01" -EnableDebugMode

Expected: Script runs in debug mode.
Actual: PowerShell throws a parameter binding error.

Fix

Add $LogPath and $EnableDebugMode to the param() block, or remove them from help text and README.

Files Affected

  • Scripts/NetworkShares/New-ShareAndDFS.ps1
  • Scripts/NetworkShares/README.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions