less command
In reference to "less" program... Here's how to use the PowerShell Community Extension less command from TCC. First, you need PowerShell, and the PowerShell Community Extensions, installed on your...
View ArticleSelect-String with Context
I have a file, astronomy.txt, which is generated by doing; Code: lynx -dump -nolist "https://www.timeanddate.com/astronomy/canada/london" > c:\utils\astronomy.txt The goal is to extract the...
View ArticlePowerShell Core 6.1 Roadmap
Details the future of the Open-Source version of PowerShell. https://blogs.msdn.microsoft.com/powershell/2018/01/24/powershell-core-6-1-roadmap/ Joe
View ArticleAll Those Years Ago
Demonstration of how to get date properties using PowerShell, based on the date x years ago, or x years from now. Code: @setlocal @echo off function AddYears=`%@pshell[$d = Get-Date; $d.AddYears(%1)]`...
View ArticleApplication type for a .DLL
When I use @EXETYPE on a .DLL, it returns 6, regardless if it is 32-bit or 64-bit; Code: c:\users\jlc\utils>echo %@exetype[ISO8601-x64.dll] 6 c:\users\jlc\utils>echo %@exetype[ISO8601.dll] 6 As...
View ArticleDuration of a Media file
Code: @setlocal @echo off pshell /s "$theFolder = 'C:\Users\jlc\Videos'" pshell /s "$theFile = 'Lana Del Rey - Love.mp4'" pshell /s "$DurationColumn = 27" pshell /s "$oShell = New-Object -com...
View ArticleRound Function
While TCC does not have a round function, the PSHELL command and/or function can be used to round a number; Code: echo %@pshell[[math]::Round(22/7)] 3 ..or... Code: pshell /s "$a=22/7" echo...
View ArticleUsing a 32-bit In-Process COM Server DLL from 64-bit TCC
I have found a method to use the 32-bit In-Process COM Server DLLs that I have created using Visual Basic 6.0 and Visual FoxPro 9.0 from 64-bit TCC via PSHELL. Using the Microsoft OLE/COM Object...
View ArticleTCC and PowerShell shared environment
I discovered something by accident today. I am using; Code: c:\users\jlc\utils>ver TCC 24.02.46 x64 Windows 7 [Version 6.1.7601] In my Powershell profile,...
View ArticleGET-History with PSHELL
I am using; Code: _x64: 1 _admin: 1 TCC 24.02.49 x64 Windows 10 [Version 10.0.18362.116] Using Get-History via PSHELL /S does not return anything. I have tried; Code: e:\utils>pshell /s...
View ArticleNetCmdlets
Just read about these in a german computer magazine (c't): <https://www.nsoftware.com/powershell/netcmdlets/> Looks interesting.
View ArticleFinding Files with Alternate Data Streams
This script shows how to use PowerShell to display only files with Alternate Data Streams; Code: get-ChildItem -recurse | % { get-item $_.FullName -stream * } | where stream -ne ':$Data' | select...
View ArticleGetCommandLine via PSHELL
I was having problems using the Kernel32.dll GetCommandLine function via @WINAPI, so I developed an alternate method using PowerShell. Here is the .BTM; Code: @setlocal @echo off type <<- endtext...
View ArticleFind text in a data stream
Further to the thread FFIND TPIPE here is a method to search for text in a data stream using PowerShell via PSHELL. Code: e:\utils>pshell /s "get-content -path test -stream 'look' | select-string...
View ArticleThe History of your PowerShell
I was not aware that PowerShell saves everything you have ever typed at the PowerShell console; Code: notepad (Get-PSReadLineOption).HistorySavePath I viewed the file, and discovered everything that I...
View ArticleUsing PSHELL from TCSTART.BTM
Code: _x64: 1 _admin: 1 _elevated: 1 TCC 25.00.20 x64 Windows 10 [Version 10.0.18362.356] OS Name: Microsoft Windows 10 Pro OS Version: 10.0.18362 N/A Build 18362 I have in my TCSTART.BTM; Code:...
View ArticlePlatform Invoke of TakeCmd.dll
I have the following function defined in my PowerShell profile; Code: function tcc { & "c:\program files\jpsoft\tcmd25\tcc.exe" /I /Q /C $args } This allows me to call Take Command internal...
View ArticleAdding up columns of a comma separated file (CSV)
Here is my method of adding up columns of a comma separated file (CSV) The .csv file consists of four columns; Code: Account,Trans_Date,Interest,Deposit While the goal is to sum the Interest and...
View ArticleUse PowerShell automation dlls for commands/scripts without PowerShell
I came across this GitHub repository called PowerShdll It allows you to run PowerShell scripts or commands without access to PowerShell. It does this by using PowerShell automation dlls. As this...
View ArticleRun a .PS1 file without PowerShell
I came across this article about how to use PowerShell without using PowerShell. Below is code to run a PowerShell .ps1 file without using PowerShell. I use CS-Script to run my C# code, but with a few...
View Article