Expand Minimize

SPC029104: Do not use direct hardcoded file paths

Exposing directory structure in a script can possibly expose the layout of internal systems. This script may also not work on other machines

CheckId SPC029104
TypeName DoNotHardcodeFilePaths
Severity CriticalWarning
Type PoShFile

Bad Practice

Get-ChildItem "C:\temp"
Get-ChildItem \\scratch2\scratch\
Good Practice
Get-ChildItem "..\temp"

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.