- Aug
- 2,039
- 82
Further to https://jpsoft.com/forums/threads/powershell-profile.8776/#post-49432
Example function in my PowerShell Profile;
From PowerShell;
From TCC 22.00.33 x64 Windows 7 [Version 6.1.7601]
From TCC 22.00.33 x64 Windows 7 [Version 6.1.7601]
How do I call a function that is in my PowerShell Profile, that works in PowerShell, using the TCC PSHELL command, since "TCC already uses PowerShell profiles"?
Joe
Code:
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\utils> $Profile
C:\Users\jlc\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Example function in my PowerShell Profile;
Code:
function today
{
gci | where { $_.LastWriteTime.Date -eq (Get-Date).Date }
}
From PowerShell;
Code:
PS C:\utils> today
Directory: C:\utils
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/16/2018 6:37 AM 8766 astronomy.txt
-a---- 1/16/2018 7:12 AM 24410 bandwidth.txt
-a---- 1/16/2018 5:03 AM 33327 jlckcalc.txt
-a---- 1/16/2018 1:45 PM 843 killstuff.txt
-a---- 1/16/2018 7:12 AM 16128 ll.txt
-a---- 1/16/2018 5:01 AM 25026 tackcalc.txt
From TCC 22.00.33 x64 Windows 7 [Version 6.1.7601]
Code:
c:\users\jlc\utils>powershell -command today
Directory: C:\Users\jlc\utils
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/16/2018 6:37 AM 8766 astronomy.txt
-a---- 1/16/2018 7:12 AM 24410 bandwidth.txt
-a---- 1/16/2018 5:03 AM 33327 jlckcalc.txt
-a---- 1/16/2018 1:45 PM 843 killstuff.txt
-a---- 1/16/2018 7:12 AM 16128 ll.txt
-a---- 1/16/2018 5:01 AM 25026 tackcalc.txt
From TCC 22.00.33 x64 Windows 7 [Version 6.1.7601]
Code:
c:\users\jlc\utils>pshell /s "today"
PSHELL: System.Management.Automation.CommandNotFoundException : The term 'today' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
How do I call a function that is in my PowerShell Profile, that works in PowerShell, using the TCC PSHELL command, since "TCC already uses PowerShell profiles"?
Joe