Advertisement
tfl

PowerShell Remoting Issue

tfl
Dec 9th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # CONSTRAINED.PSSC
  2. @{
  3. # Version number of the schema used for this configuration file
  4. SchemaVersion = '1.0.0.0'
  5. # ID used to uniquely identify this session configuration.
  6. GUID = '987d7c91-712c-4673-808e-27b323a067e3'
  7. # Specifies the execution policy for this session configuration
  8. ExecutionPolicy = 'Restricted'
  9. # Specifies the language mode for this session configuration
  10. LanguageMode = 'NoLanguage'
  11. # Initial state of this session configuration
  12. SessionType = 'Default'
  13. # Environment variables defined in this session configuration
  14. # EnvironmentVariables =
  15. # Author of this session configuration
  16. Author = 'Thomas Lee'
  17. # Company associated with this session configuration
  18. CompanyName = 'PSP'
  19. # Copyright statement for this session configuration
  20. Copyright = '(c) 2012 PSP. All rights reserved.'
  21. # Description of the functionality provided by this session configuration
  22. # Description =
  23. # Version of the Windows PowerShell engine used by this session configuration
  24. # PowerShellVersion =
  25. # Modules that will be imported.
  26. ModulesToImport = @("ServerManager")
  27. # Assemblies that will be loaded in this session configuration
  28. # AssembliesToLoad =
  29. # Cmdlets visible in this session configuration
  30. VisibleCmdlets = @("Get-ChildItem", "Get-Help", "exit-pssession",
  31.  "Get-Module","Measure-Object",'Select-Object', 'Get-Command', 'Out-Default')
  32. # Functions visible in this session configuration
  33. # VisibleFunctions =
  34. # Providers visible in this session configuration
  35. # VisibleProviders =
  36. # Aliases defined in this session configuration
  37. AliasDefinitions =  @{Name="hlp";Definition="Get-Help"   ;Description="Gets help";Options="Readonly"},
  38.                     @{Name='l';Definition='Get-ChildItem';Options='ReadOnly'}
  39. # Aliases visible in this session configuration
  40. VisibleAliases = @("gh", "gci", "gcm", "exit", 'hlp', 'l')
  41. # Functions defined in this session configuration
  42. # FunctionDefinitions =
  43. # Variables defined in this session configuration
  44. # VariableDefinitions =
  45. # Type files (.ps1xml) that will be loaded in this session configuration
  46. # TypesToProcess =
  47. # Format files (.ps1xml) that will be loaded in this session configuration.
  48. # FormatsToProcess =
  49. # Specifies the scripts to run after the session is configured
  50. # ScriptsToProcess =
  51. }
  52.  
  53. # REgister SCF on Remote system
  54. Register-PSSessionConfiguration -name Constrained -Accessmode Remote -FOrce  -Path C:\foo\Constrained.pssc
  55.  
  56. # On local machine
  57. $s = New-PSSession -ComputerName Cookham12 -ConfigurationName constrained; $s
  58. Enter-Pssession $s
  59.  
  60. Then I see  HLP does not work. :-(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement