- Aug
- 2,799
- 144
Ref: Using PowerShell from TCC without a 3rd-Party DLL
The ALIAS command is working as documented,
but what I want to do may be too complicated for it.
Expanded, the alias becomes;
Question: How did the quotes get wrappeed around the URL?
Expanded, the PShell alias becomes...
...and while it works un-expanded, it does not work expanded.
That's because of the SETDOS /X-5 command.
With SETDOS /X+5 active, the expanded alias becomes;
With SETDOS /X-5 active, the expanded alias becomes...
...and works as it should.
When I change the PShell alias to incorporate SETDOS...
I expect that I will be encountering other issues as I progress,
so I'm thinking that maybe a library function would be a better choice than an alias in this instance?
Ref: SETDOS command - Display or set the TCC configuration
Ref: ALIAS command - create new command names
Joe
The ALIAS command is working as documented,
but what I want to do may be too complicated for it.
Code:
E:\Utils>ver
TCC 36.00.17 x64 Windows 10 [Version 10.0.19045.7058]
E:\Utils>which pshell
pshell is an alias : curl -s -X POST -d "%$" http://127.0.0.1:8080/
E:\Utils>pshell get-date;2026-1960
April 6, 2026 2:26:20 PM
66
Expanded, the alias becomes;
Code:
E:\Utils>curl -s -X POST -d "get-date;2026-1960" "http://127.0.0.1:8080/"
Question: How did the quotes get wrappeed around the URL?
Code:
E:\Utils>setdos /x-5
E:\Utils>pshell $jlc = new-object -com Scripting.FileSystemObject;$jlc | get-member
TypeName: System.__ComObject#{2a0b9d10-4b87-11d3-a97a-00104b365c9f}
Name MemberType Definition
---- ---------- ----------
BuildPath Method string BuildPath (string Path, string Name)
CopyFile Method void CopyFile (string Source, string Destination, bool OverWriteFiles)
CopyFolder Method void CopyFolder (string Source, string Destination, bool OverWriteFiles)
CreateFolder Method IFolder CreateFolder (string Path)
CreateTextFile Method ITextStream CreateTextFile (string FileName, bool Overwrite, bool Unicode)
DeleteFile Method void DeleteFile (string FileSpec, bool Force)
DeleteFolder Method void DeleteFolder (string FolderSpec, bool Force)
DriveExists Method bool DriveExists (string DriveSpec)
FileExists Method bool FileExists (string FileSpec)
FolderExists Method bool FolderExists (string FolderSpec)
GetAbsolutePathName Method string GetAbsolutePathName (string Path)
GetBaseName Method string GetBaseName (string Path)
GetDrive Method IDrive GetDrive (string DriveSpec)
GetDriveName Method string GetDriveName (string Path)
GetExtensionName Method string GetExtensionName (string Path)
GetFile Method IFile GetFile (string FilePath)
GetFileName Method string GetFileName (string Path)
GetFileVersion Method string GetFileVersion (string FileName)
GetFolder Method IFolder GetFolder (string FolderPath)
GetParentFolderName Method string GetParentFolderName (string Path)
GetSpecialFolder Method IFolder GetSpecialFolder (SpecialFolderConst SpecialFolder)
GetStandardStream Method ITextStream GetStandardStream (StandardStreamTypes StandardStreamType, bool Unicode)
GetTempName Method string GetTempName ()
MoveFile Method void MoveFile (string Source, string Destination)
MoveFolder Method void MoveFolder (string Source, string Destination)
OpenTextFile Method ITextStream OpenTextFile (string FileName, IOMode IOMode, bool Create, Tristate Format)
Drives Property IDriveCollection Drives () {get}
E:\Utils>setdos /x+5
Expanded, the PShell alias becomes...
Code:
E:\Utils>curl -s -X POST -d "$jlc = new-object -com Scripting.FileSystemObject;$jlc " "http://127.0.0.1:8080/|"
get-member
...and while it works un-expanded, it does not work expanded.
Code:
E:\Utils>curl -s -X POST -d "$jlc = new-object -com Scripting.FileSystemObject;$jlc " "http://127.0.0.1:8080/|"
get-member
Drives
------
System.__ComObject
That's because of the SETDOS /X-5 command.
With SETDOS /X+5 active, the expanded alias becomes;
Code:
E:\Utils>setdos /x+5
E:\Utils>curl -s -X POST -d "$jlc = new-object -com Scripting.FileSystemObject;$jlc " "http://127.0.0.1:8080/|"
get-member
With SETDOS /X-5 active, the expanded alias becomes...
Code:
E:\Utils>setdos /x-5
E:\Utils>curl -s -X POST -d "$jlc = new-object -com Scripting.FileSystemObject;$jlc | get-member" "http://127.0
.0.1:8080/"
...and works as it should.
When I change the PShell alias to incorporate SETDOS...
Code:
E:\Utils>which pshell
pshell is an alias : setdos /X-5 & curl -s -X POST -d "%$" http://127.0.0.1:8080/ & setdos /X+5
E:\Utils>pshell $jlc = new-object -com Scripting.FileSystemObject;$jlc | get-member
TCC: (Sys) The parameter is incorrect.
"&"
I expect that I will be encountering other issues as I progress,
so I'm thinking that maybe a library function would be a better choice than an alias in this instance?
Ref: SETDOS command - Display or set the TCC configuration
Ref: ALIAS command - create new command names
Joe