- Aug
- 2,039
- 82
Code:
c:\users\jlc\utils>ver
TCC 22.00.38 x64 Windows 7 [Version 6.1.7601]
I have a text file;
Code:
c:\users\jlc\utils>type test.txt
The
quick
brown
FOX
jumped
over
the
lazy
dog
I have a Powershell script;
Code:
c:\users\jlc\utils>type test.ps1
$a = Get-Content '.\test.txt'
$b = $a.Replace('FOX','Fox')
$b | out-file '.\test.txt'
type .\test.txt
When I run this Powershell script from TCC using PSHELL;
Code:
c:\users\jlc\utils>pshell test.ps1
PSHELL: System.Management.Automation.RuntimeException : You cannot call a method on a null-valued expression.
When I run this Powershell script from Powershell;
Code:
c:\users\jlc\utils>powershell -file test.ps1
The
quick
brown
Fox
jumped
over
the
lazy
dog
...it works as it should.
Why can PSHELL not run this script?
Joe