- Aug
- 2,056
- 83
Code:
_x64: 1
_admin: 1
_elevated: 1
TCC 27.00.18 x64 Windows 10 [Version 10.0.18363.1256]
In v26, I see my PowerShell Profile;
Code:
e:\utils>pshell /s "$profile"
e:\Documents\WindowsPowershell\Microsoft.PowerShell_profile.ps1
In v27, I see my PowerShell Profile;
Code:
e:\utils>pshell /s "$Profile"
e:\Documents\WindowsPowershell\Microsoft.PowerShell_profile.ps1
In my $Profile, I have many UDFs, such as CreateObject.
In v26, this works;
Code:
e:\utils>pshell /s "$jlc = CreateObject('jlcutils.clsMath')"
e:\utils>pshell /s "$jlc | get-member"
TypeName: System.__ComObject#{fdd19134-ea6a-43c0-90aa-00cc2ff3989a}
Name MemberType Definition
---- ---------- ----------
ppp Method Variant ppp (Variant)
vb6Val Method double vb6Val (string)
World Method Variant World (string)
In v27, it does not work;
Code:
e:\utils>pshell /s "$jlc = CreateObject('jlcutils.clsMath')"
PSHELL: System.Management.Automation.CommandNotFoundException : The term 'CreateObject' 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.
In v27, none of my user defined functions from my $Profile work.
What has changed?
From the "What's New In Version 27";
Code:
What's New in Version 27
PowerShellProfileID=string - The profile Id to look for when loading profiles. TCC will look for profiles that begin with the specified Id. For instance, the default value is "Microsoft.PowerShell" so the class will look for profiles named "Microsoft.PowerShell_profile.ps1".
Can others who have UDFs in their $Profile see if they work in v27?
Joe