The following script
# Define the network path
$networkPath = "\\your\network\path"
# Check if the path exists
if (Test-Path $networkPath) {
# Get all files at the network path
$files = Get-ChildItem -Path $networkPath -File
# Sort the files in alphabetical order
$sortedFiles = $files | Sort-Object Name
# Print a line for each file
foreach ($file in $sortedFiles) {
Write-Host ("Path: " + $file.FullName)
}
}
else {
Write-Host "The network path $networkPath does not exist."
}