mirror of
https://github.com/serialexperiments0815/PowershellExcercises.git
synced 2026-11-07 12:55:30 +00:00
Corrected many "./" path entries to $($PSScriptRoot).
This commit is contained in:
parent
0e1b23f888
commit
9dc9824b12
9 changed files with 17 additions and 17 deletions
|
|
@ -4,4 +4,4 @@
|
|||
# '-File' returns results for files only, no directories.
|
||||
# '-Filter' returns results for specified string pattern.
|
||||
|
||||
Get-ChildItem -Path "./" -Recurse -File -Filter *.ps1
|
||||
Get-ChildItem -Path "$($PSScriptRoot)" -Recurse -File -Filter *.ps1
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# '-Recurse' instructs iterations through subdirectories.
|
||||
# '-File' returns results for files only, no directories.
|
||||
|
||||
Get-ChildItem -Path './' -Recurse -File |
|
||||
Get-ChildItem -Path "$($PSScriptRoot)" -Recurse -File |
|
||||
|
||||
# Call 'Select-Object' cmdlet method to return specified properties.
|
||||
# '-Property FullName' returns full String path for each object.
|
||||
|
|
@ -15,4 +15,4 @@ Get-ChildItem -Path './' -Recurse -File |
|
|||
# '-Path './folderFiles.csv'' returns output of file in current directory.
|
||||
# '-NoTypeInformation' supresses #TYPE metadata line.
|
||||
|
||||
Export-Csv -Path './folderFiles.csv' -NoTypeInformation
|
||||
Export-Csv -Path "$($PSScriptRoot)/folderFiles.csv" -NoTypeInformation
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
# "./" In current directory.
|
||||
# "-Filter *.PNG" Of the type PNG.
|
||||
|
||||
Get-ChildItem "./" -Filter *.PNG |
|
||||
Get-ChildItem "$($PSScriptRoot)" -Filter *.PNG |
|
||||
|
||||
# Calling 'ForEach-Object' loop method for iterating through returned files.
|
||||
ForEach-Object {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue