I am using Invoke-Command { & "powershell.exe" } -NoNewScope
and getting error as belove.
powershell.exe : Loading personal and system profiles took 1761ms.
At line:1 char:18
Invoke-Command { & "powershell.exe" } -NoNewScope
~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (Loading persona...es took 1761ms.:String
) [], RemoteException
FullyQualifiedErrorId : NativeCommandError
... you must use New PowerShell Tab option, to get a new session and your profile will load there.
You can use the shortcut key of course. CRTL T
Differences between the ISE and PowerShell console - PowerShell Team
Console Application (Non) Support in the ISE
$psUnsupportedConsoleApplications
# Results
<#
wmic
wmic.exe
cmd
cmd.exe
diskpart
diskpart.exe
edit.com
netsh
netsh.exe
nslookup
nslookup.exe
powershell
powershell.exe
ssh-keygen
ssh-keygen.exe
#>
PowerShell- Running Executables - TechNet Articles - United States (English) - TechNet Wiki