Severity Level: Error
If a file path is used in a script that refers to a file on the computer or on the shared network, this could expose sensitive information or result in availability issues.
Care should be taken to ensure that no computer or network paths are hard coded, instead non-rooted paths should be used.
Ensure that no network paths are hard coded and that file paths are non-rooted.
Function Get-MyCSVFile
{
$FileContents = Get-FileContents -Path "\\scratch2\scratch\"
...
}
Function Write-Documentation
{
Write-Warning "E:\Code"
...
}Function Get-MyCSVFile ($NetworkPath)
{
$FileContents = Get-FileContents -Path $NetworkPath
...
}
Function Write-Documentation
{
Write-Warning "..\Code"
...
}