By JonZ and x0n:
pssessions , .
Enter-PSSession . , $pshome.
, ( , , ..), ( ).
Register-PSSessionConfiguration . Get-PSSessionConfiguration . Get-PSSessionConfiguration, Register-PSSessionConfiguration ( PowerShell " ").
, profile.ps1 :
Register-PSSessionConfiguration -Name WithProfile -StartupScript $PsHome\Profile.ps1
, :
Enter-PSSession -ComputerName $computername -ConfigurationName WithProfile
Enter-PSSession -ComputerName $computername -ConfigurationName WithProfile -Credential youradminuser@yourtargetdomain
( $computername - , pssession).
PowerShell Remoting Powershell Remoting.
:
Powershell Remoting: , Powershell? http://jrich523.wordpress.com/2010/07/21/update-creating-a-profile-for-a-remote-session/
PowerShell
http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/04/understanding-and-using-powershell-profiles.aspx
About_Profiles (Microsoft Docs) https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles
Windows PowerShell
, -
$ Home [My] \WindowsPowerShell\Profile.ps1
,
$ [] \Profile.ps1
, -
$ PsHome\Microsoft.PowerShell_profile.ps1
,
$ PsHome\Profile.ps1
, - ISE
$ [] \WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
, - ISE
$ PsHome\Microsoft.PowerShellISE_profile.ps1
Windows PowerShell
http://msdn.microsoft.com/en-us/library/bb613488%28VS.85%29.aspx
.
% WINDIR%\system32\WindowsPowerShell\v1.0\profile.ps1
, Microsoft.PowerShell.
% windir%\system32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
, .
% UserProfile%\ \WindowsPowerShell\profile.ps1
Microsoft.PowerShell.
% UserProfile%\ \WindowsPowerShell\Microsoft.PowerShell_profile.ps1
PowerShell https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles
.
$ ENV: ProgramFiles\PowerShell\6\profile.ps1
, .
$ ENV: ProgramFiles\PowerShell\6\Microsoft.PowerShell_profile.ps1
, .
$ ENV: USERPROFILE\Documents\PowerShell\profile.ps1
Microsoft.PowerShell.
$ ENV: USERPROFILE\Documents\PowerShell\Microsoft.PowerShell_profile.ps1