{"id":20401863,"url":"https://github.com/oising/poke","last_synced_at":"2025-07-31T18:06:51.259Z","repository":{"id":22999305,"uuid":"26349871","full_name":"oising/poke","owner":"oising","description":"A powerful reflection module for powershell.","archived":false,"fork":false,"pushed_at":"2023-11-24T21:13:55.000Z","size":180,"stargazers_count":89,"open_issues_count":3,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-26T08:51:38.716Z","etag":null,"topics":["debugging","diagnostics","dotnet","dotnet-core","powershell","reflection","utility"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oising.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-11-08T04:36:57.000Z","updated_at":"2025-02-16T01:28:48.000Z","dependencies_parsed_at":"2024-01-07T13:09:56.950Z","dependency_job_id":null,"html_url":"https://github.com/oising/poke","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oising%2Fpoke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oising%2Fpoke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oising%2Fpoke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oising%2Fpoke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oising","download_url":"https://codeload.github.com/oising/poke/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578994,"owners_count":21127740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","diagnostics","dotnet","dotnet-core","powershell","reflection","utility"],"created_at":"2024-11-15T04:52:04.442Z","updated_at":"2025-04-12T14:23:05.502Z","avatar_url":"https://github.com/oising.png","language":"PowerShell","funding_links":[],"categories":["Misc"],"sub_categories":[],"readme":"# Poke\n\n(build CI is broken, apologies)\n\n[![Build status](https://ci.appveyor.com/api/projects/status/0gil31jtywx1c849?svg=true)](https://ci.appveyor.com/project/oising/poke)\n\n### PowerShellGallery\n\n[https://www.powershellgallery.com/packages/poke/]\n\nHere you'll find examples of how to peek and poke objects using the Poke module.\n\n### Version History\n\n* 1.1.2 - fixes sort alias clash on *nix (thanks @fsackur)\n* 1.1   - adds support for invoking methods with ref/out parameters ([ref])\n* 1.0.2 - readonly fields are now settable like regular fields\n* 1.0.1 - Compatibility fixes for v3 beta / .net 4.5\n* 1.0   - Initial release\n    \n### Examples\n\n```powershell\n# peek at a Job instance using pipeline syntax\n$job = start-job { 42 } | peek\n$job | get-member\n```\nwhich results in the new extended output format for get-member:\n```\n   TypeName:\nPokeable.System.Management.Automation.PSRemotingJob#676f9716-c167-47c6-ab0d-4d8cedbbe44d\n\nName                            Modifier  MemberType Definition\n----                            --------  ---------- ----------\nEquals                          public    Method     bool Equals(System.Object obj)\nGetHashCode                     public    Method     int GetHashCode()\nGetType                         public    Method     type GetType()\nCheckDisconnectedAndUpdateState private   Method*    void CheckDisconnectedAndUpdateState(System....\nCommonInit                      private   Method*    void CommonInit(int throttleLimit, System.Co...\nConnectJob                      internal  Method*    void ConnectJob(guid runspaceInstanceId)\nConnectJobs                     internal  Method*    void ConnectJobs()\nConstructLocation               private   Method*    string ConstructLocation()\nDispose                         protected Method*    void Dispose(bool disposing)\nFindDisconnectedChildJob        private   Method*    System.Management.Automation.PSRemotingChild...\nGetAssociatedPowerShellObject   internal  Method*    powershell GetAssociatedPowerShellObject(gui...\nGetJobsForComputer              internal  Method*    System.Collections.Generic.List[System.Manag...\nGetJobsForOperation             internal  Method*    System.Collections.Generic.List[System.Manag...\nGetJobsForRunspace              internal  Method*    System.Collections.Generic.List[System.Manag...\nGetRunspaces                    internal  Method*    System.Collections.Generic.IEnumerable`1[[Sy...\nHandleChildJobStateChanged      private   Method*    void HandleChildJobStateChanged(System.Objec...\nHandleJobUnblocked              private   Method*    void HandleJobUnblocked(System.Object sender...\nInternalStopJob                 internal  Method*    void InternalStopJob()\nSetStatusMessage                private   Method*    void SetStatusMessage()\nStopJob                         public    Method*    void StopJob()\nSubmitAndWaitForConnect         private   Method*    void SubmitAndWaitForConnect(System.Collecti...\nToString                        public    Method*    string ToString()\n__GetBaseObject                 -         Method*    System.Management.Automation.PSRemotingJob, ...\n__GetModuleInfo                 -         Method*    psmoduleinfo __GetModuleInfo()\natleastOneChildJobFailed        private   Field*     bool atleastOneChildJobFailed\nblockedChildJobsCount           private   Field*     int blockedChildJobsCount\nCanDisconnect                   internal  Property*  bool CanDisconnect { get; set; }\ndisconnectedChildJobsCount      private   Field*     int disconnectedChildJobsCount\nfinishedChildJobsCount          private   Field*     int finishedChildJobsCount\nHasMoreData                     public    Property*  bool HasMoreData { get; set; }\nHideComputerName                internal  Property*  bool HideComputerName { get; set; }\nisDisposed                      private   Field*     bool isDisposed\nLocation                        public    Property*  string Location { get; set; }\nmoreData                        private   Field*     bool moreData\nStatusMessage                   public    Property*  string StatusMessage { get; set; }\nthrottleManager                 private   Field*     System.Management.Automation.Remoting.Thrott...\n_stopIsCalled                   private   Field*     bool _stopIsCalled\n_syncObject                     private   Field*     System.Object _syncObject\n```\n\nYou can call methods, set fields and properties (if they have setters - it doesn't matter if they're private, protected or internal.)\n\nYou can proxy Types as well as instances:\n```powershell\n# proxy a public type by piping it\n$type = [text.stringbuilder] | peek\n```\n```\n   TypeName: Pokeable.System.RuntimeType#System.Text.StringBuilder\n\nName             Modifier MemberType Definition\n----             -------- ---------- ----------\nEquals           public   Method     bool Equals(System.Object obj)\nGetHashCode      public   Method     int GetHashCode()\nGetType          public   Method     type GetType()\nFormatError      private  Method*    static void FormatError()\nThreadSafeCopy   private  Method*    static void ThreadSafeCopy(System.Char*, mscorlib, Version=4...\nToString         public   Method*    string ToString()\n__CreateInstance -        Method*    .ctor (), .ctor (int capacity), .ctor (string value), .ctor ...\n__GetBaseObject  -        Method*    type __GetBaseObject()\n__GetModuleInfo  -        Method*    psmoduleinfo __GetModuleInfo()\nCapacityField    private  Field*     string CapacityField\nDefaultCapacity  internal Field*     int DefaultCapacity\nMaxCapacityField private  Field*     string MaxCapacityField\nMaxChunkSize     internal Field*     int MaxChunkSize\nStringValueField private  Field*     string StringValueField\nThreadIDField    private  Field*     string ThreadIDField\n```\nPeeking at non-public types:\n```powershell\n# nonpublic types can't be specified using type literal\n# syntax, so in this case you should use the -name parameter\n$type = peek -name MS.Internal.Xml.XPath.XPathParser\n\n# nonpublic objects returned from methods, properties or fields\n# are not \"peeked\" themselves, so you may need to peek the return value:\n$manager = peek (start-job { 42 } | peek).throttlemanager\n$manager.throttlelimit = 64 # bump throttle limit ;)\n```\nOf course, you can peek instances too:\n```powershell\n$sb = new-object system.text.stringbuilder\n$proxy = peek $sb\n$proxy | gm\n```\n```\n   TypeName: Pokeable.System.Text.StringBuilder#45f12364-1906-45b3-b48b-a77acd81e3f0\n\nName                                                     Modifier MemberType Definition\n----                                                     -------- ---------- ----------\nGetHashCode                                              public   Method     int GetHashCode()\nGetType                                                  public   Method     type GetType()\nAppend                                                   public   Method*    System.Text.StringBu...\nAppendFormat                                             public   Method*    System.Text.StringBu...\nAppendHelper                                             private  Method*    void AppendHelper(st...\nAppendLine                                               public   Method*    System.Text.StringBu...\nClear                                                    public   Method*    System.Text.StringBu...\nCopyTo                                                   public   Method*    void CopyTo(int sour...\nEnsureCapacity                                           public   Method*    int EnsureCapacity(i...\nEquals                                                   public   Method*    bool Equals(System.T...\nExpandByABlock                                           private  Method*    void ExpandByABlock(...\nFindChunkForByte                                         private  Method*    System.Text.StringBu...\nFindChunkForIndex                                        private  Method*    System.Text.StringBu...\nInsert                                                   public   Method*    System.Text.StringBu...\nInternalCopy                                             internal Method*    void InternalCopy(Sy...\nMakeRoom                                                 private  Method*    void MakeRoom(int in...\nNext                                                     private  Method*    System.Text.StringBu...\nRemove                                                   private  Method*    System.Text.StringBu...\nReplace                                                  public   Method*    System.Text.StringBu...\nReplaceAllInChunk                                        private  Method*    void ReplaceAllInChu...\nReplaceBufferAnsiInternal                                internal Method*    void ReplaceBufferAn...\nReplaceBufferInternal                                    internal Method*    void ReplaceBufferIn...\nReplaceInPlaceAtChunk                                    private  Method*    void ReplaceInPlaceA...\nStartsWith                                               private  Method*    bool StartsWith(Syst...\nSystem.Runtime.Serialization.ISerializable.GetObjectData private  Method*    void System.Runtime....\nToString                                                 public   Method*    string ToString()\nVerifyClassInvariant                                     private  Method*    void VerifyClassInva...\n__GetBaseObject                                          -        Method*    System.Text.StringBu...\n__GetModuleInfo                                          -        Method*    psmoduleinfo __GetMo...\nCapacity                                                 public   Property*  int Capacity { get; ...\nChars                                                    public   Property*  char Chars { get; se...\nLength                                                   public   Property*  int Length { get; se...\nMaxCapacity                                              public   Property*  int MaxCapacity { ge...\nm_ChunkChars                                             internal Field*     char[] m_ChunkChars\nm_ChunkLength                                            internal Field*     int m_ChunkLength\nm_ChunkOffset                                            internal Field*     int m_ChunkOffset\nm_ChunkPrevious                                          internal Field*     System.Text.StringBu...\nm_MaxCapacity                                            internal Field*     int m_MaxCapacity\n```\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foising%2Fpoke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foising%2Fpoke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foising%2Fpoke/lists"}