JasonMArcher
Reputation
Top tag
Next privilege 200 Rep.
1 6
Impact
~2k people reached

• 0 posts edited

# 17 Actions

 May 2 awarded Constituent Apr 29 awarded Caucus Dec 17 awarded Revival Nov 24 comment Deleting entire lines in a text file based on a partial string match with Windows PowerShell Get-Content .\in.txt | Where-Object {\$_ -notmatch 'not'} | Set-Content out.txt Out-File is basically Set-Content, but it runs the input through the default formatting instead of simple string conversion. Nov 1 awarded Teacher Jan 28 comment Powershell overruling Perl binmode? Its the pipe character and is used the same way as DOS and Unix shells. In this case you use Set-Content so that we can use the Byte encoding. Jan 12 answered Powershell overruling Perl binmode? Oct 19 comment Create DFS folder with particular permisson? Sounds like a question for serverfault.com. Oct 16 comment WinRM - what it is and how to use it? Two separate things here. For PowerShell Remoting (over WinRM), there is no Linux client and mostly likely won't be. WinRM is based on standards, so there should be interoperability, at least eventually. Oct 16 comment Powershell tab-complete trailing slash PowerTab will not add trailing backslashes to a directory, but it does support recursive tab expansion based on typing a backslash. The reason for this is that it would break chaining of tab expansion. PowerShell will only call a new TabExpansion() if the command line has changed since the last TabExpansion(). So adding a backslash to the result would mean that you could not press again. Aug 17 answered Change Powershell tab-complete behavior to not expand relative paths to absolute ones Aug 17 comment Deleting entire lines in a text file based on a partial string match with Windows PowerShell I would suggest that you use Set-Content instead of Out-File, the former deals in raw data and won't cut off strings or format objects. Aug 11 comment Windows 7: run powershell v2 from start menu's run command PowerShell 2.0 replaces 1.0. Originally the PS team planned for possible incompatibilities, that is why the script extensions are also .ps1. Aug 11 comment Why setting Powershell to set-executionpolicy remotesigned fails? He means that you need to run in an elevated prompt. You can right-click on the PowerShell icon in the task bar or start menu and select "Run as Administrator". Aug 11 awarded Critic Aug 11 awarded Supporter Mar 23 awarded Autobiographer