Skip to content

About

Generate and test complex password

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Sanatize files via PowerShell

Remove ".TXT" file name extension from files with a nested extensions. For example rename BATCH.CMD.TXT to BATCH.CMD or SCRIPT.PS1.TXT to SCRIPT.PS1.

Remove *.TXT extension for any file name with a nested extension ending with '.TXT'

Get-ChildItem -Path ..TXT -File -Recurse | ForEach-Object { Rename-Item -Path $PSItem.VersionInfo.FileName -NewName ( $PSItem.VersionInfo.FileName -Replace '.TXT$', '' ) -PassThru }

Add .TXT extention for all script files (.PS1, *.CMD, *.BAT)

Get-ChildItem .PS1,.CMD,.BAT -Exclude *.TXT -File -Recurse | ForEach-Object { Rename-Item -Path $PSItem.VersionInfo.FileName -NewName "$($PSItem.VersionInfo.FileName).TXT" -PassThru }

Unblock all files marked remote.

Get-ChildItem -File -Recurse | ForEach-Object { Try { (Get-Item $PSItem.VersionInfo.FileName -Stream 'Zone.Identifier' -ErrorAction Stop).FileName; Unblock-File $PSItem.VersionInfo.FileName } Catch { } }

About

Generate and test complex password

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages