Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Path = "$Home\Documents\WindowsPowerShell\tmp"
- $ExcludeFiles = '*.psm1'
- $IncludeFiles = '*.ps1'
- #Bad way!
- If($ExcludeFiles)
- {
- if($IncludeFiles)
- {
- $Files = Get-ChildItem -Path $Path -Recurse -Include $IncludeFiles
- }
- else
- {
- $Files = Get-ChildItem -Path $Path -Recurse
- }
- }
- else
- {
- if($IncludeFiles)
- {
- $Files = Get-ChildItem -Path $Path -Recurse -Exclude $ExcludeFiles -Include $IncludeFiles
- }
- else
- {
- $Files = Get-ChildItem -Path $Path -Recurse -Exclude $ExcludeFiles
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement