Skip to main content

Posts

Showing posts from 2019

Find Which Process or Program is Using a File or Directory

For whatever a reason a file of directory may get locked or blocked by another process or program. To find out which Process Explorer can be used available at  https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer .

Git Snippets

Just a record of useful or infrequently used Git snippets: To take all of the changes from the branch to be merged i.e. theirs: File: git-merge-all-their-changes ------------------------- git merge -Xtheirs branch-to-merge

Change File Encoding with Powershell

To bulk modify the encoding of files using PowerShell: File: alter-encoding.ps ----------------------- Get-ChildItem -Path C:\some-dir\* -Include *.ext -Recurse | ForEach-Object { $content = Get-Content $_.FullName $content | Out-File -Encoding UTF8NoBOM $_.FullName #write-host "Encoding changed:" $_.FullName } Requirements PowerShell 6.2.3   References Microsoft Docs PowerShell 6 Get-ChildItem Microsoft Docs PowerShell 6 ForEach-Object