Gist: psisContainer > Filter Directories using Powershell

To filter the folders (i.e., directories) available in the current context, the following property can be used with a predicate:$_.psiscontainer

In essence, it returns a boolean indicating whether the current object is a directory or not. Hence, the following script prints the absolute path of the each sub-directories from the current context.

ls –r | ?{$_.psiscontainer} | select fullname
Advertisements

Remove SVN binding

By invoking the following powershell commands, svn binding can be removed effectively from the current source directory.

It just traverses all the subdirectories of the current directory and remove its enclosed .svn directories. As a result, the associated svn bindings get removed.

PowerShell | Removing SVN bindings from a directory

There are several ways to remove svn binding from a directory and its sub-directories. However, in this post, we write a PowerShell script to perform this task.  To do so, we have to remove all the enclosing directories named “.svn“.   

Following PowerShell script first gets all the directories that we want remove and then, delete them one-by-one recursively.


ls -Include .svn -Recurse -Force | foreach { del $_.FullName -Recurse -Force }