{"id":13595858,"url":"https://github.com/FranciscoNabas/WindowsUtils","last_synced_at":"2025-04-09T13:33:41.481Z","repository":{"id":58743436,"uuid":"522725537","full_name":"FranciscoNabas/WindowsUtils","owner":"FranciscoNabas","description":"PowerShell module to aid Windows computers administration.","archived":false,"fork":false,"pushed_at":"2025-01-02T01:20:54.000Z","size":127528,"stargazers_count":32,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-02T02:29:25.299Z","etag":null,"topics":["powershell","powershell-module","sysadmin","system-administration","windows","windows-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FranciscoNabas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-08T22:27:18.000Z","updated_at":"2025-01-02T01:20:51.000Z","dependencies_parsed_at":"2024-08-01T16:40:37.617Z","dependency_job_id":"e29548bc-4416-48d7-8727-c8911dfed1b2","html_url":"https://github.com/FranciscoNabas/WindowsUtils","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoNabas%2FWindowsUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoNabas%2FWindowsUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoNabas%2FWindowsUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoNabas%2FWindowsUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FranciscoNabas","download_url":"https://codeload.github.com/FranciscoNabas/WindowsUtils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049725,"owners_count":21039267,"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":["powershell","powershell-module","sysadmin","system-administration","windows","windows-server"],"created_at":"2024-08-01T16:01:59.384Z","updated_at":"2025-04-09T13:33:40.352Z","avatar_url":"https://github.com/FranciscoNabas.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# WindowsUtils\n  \n**WindowsUtils** is a PowerShell module designed to make easier the administration of Windows computers.  \nThe module consists in a library written in C++/CLI which contains the main functions, and the .NET wrapper.  \nTo get information on how to use it, use **Get-Help _Cmdlet-Name_ -Full**.  \n  \n- [WindowsUtils](#windowsutils)\n  - [Installation](#installation)\n  - [Cmdlets](#cmdlets)\n    - [Invoke-RemoteMessage](#invoke-remotemessage)\n    - [Get-RemoteMessageOptions](#get-remotemessageoptions)\n    - [Get-ComputerSession](#get-computersession)\n    - [Send-Click](#send-click)\n    - [Get-ResourceMessageTable](#get-resourcemessagetable)\n    - [Get-ErrorString (gerrmess)](#get-errorstring-gerrmess)\n    - [Get-LastWin32Error](#get-lastwin32error)\n    - [Get-ObjectHandle (gethandle)](#get-objecthandle-gethandle)\n    - [Get-MsiProperties](#get-msiproperties)\n    - [Disconnect-Session (disconnect)](#disconnect-session-disconnect)\n    - [Remove-Service](#remove-service)\n    - [Get-ServiceSecurity](#get-servicesecurity)\n    - [New-ServiceAccessRule](#new-serviceaccessrule)\n    - [New-ServiceAuditRule](#new-serviceauditrule)\n    - [Set-ServiceSecurity](#set-servicesecurity)\n    - [Get-InstalledDotnet (getdotnet)](#get-installeddotnet-getdotnet)\n    - [Expand-Cabinet](#expand-cabinet)\n    - [Start-Tcping (tcping)](#start-tcping-tcping)\n    - [Start-ProcessAsUser (runas)](#start-processasuser-runas)\n    - [Get-NetworkFile (psfile, getnetfile)](#get-networkfile-psfile-getnetfile)\n    - [Close-NetworkFile (closenetfile)](#close-networkfile-closenetfile)\n    - [New-Cabinet](#new-cabinet)\n    - [Test-Port (testport)](#test-port-testport)\n    - [Get-ProcessModule (listdlls)](#get-processmodule-listdlls)\n    - [Suspend-Process (suspend)](#suspend-process-suspend)\n    - [Resume-Process (resume)](#resume-process-resume)\n    - [Get-ErrorInformation (err)](#get-errorinformation-err)\n    - [Get-MsiSummaryInfo](#get-msisummaryinfo)\n    - [Get-MsiTableInfo](#get-msitableinfo)\n    - [Get-MsiTableData](#get-msitabledata)\n    - [Invoke-MsiQuery (imsisql)](#invoke-msiquery-imsisql)\n  - [Changelog](#changelog)\n  - [Support](#support)\n  \n## Installation\n  \nThis module is available on the [PowerShell Gallery](https://www.powershellgallery.com/packages/WindowsUtils).  \nTo install it, you can use **PowerShellGet**.  \n  \n```powershell\nInstall-Module -Name 'WindowsUtils'\nImport-Module -Name 'WindowsUtils'\n```\n  \nIf you clone the repository, build **WindowsUtils.csproj**, and the module will be found at **.\\bin\\WindowsUtils**.  \nTo import it in a PowerShell session, use **Import-Module** on the module manifest or folder.  \n  \n```powershell\nImport-Module -Name '.\\bin\\WindowsUtils'\nImport-Module -Name '.\\bin\\WindowsUtils\\WindowsUtils.psd1'\n```\n  \n## Cmdlets\n  \n### Invoke-RemoteMessage\n  \nThis Cmdlet is the **Windows Terminal Services** equivalent of the **MessageBox** function.  \nIt allows you to send messages on the local, or remote computers. On all or selected interactive sessions.  \n  \n```powershell\nInvoke-RemoteMessage -Title 'Awesome message!' -Message 'Hello dude.' -SessionId 1 -Style 'MB_OKCANCEL','MB_ICONINFORMATION' -Timeout 30 -Wait\n```\n  \n### Get-RemoteMessageOptions\n  \nThis Cmdlet returns all options available to be used with the parameter **Style**, from **Invoke-RemoteMessage**.  \nThese options are named like the ones from the [MessageBox](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox) function.  \n  \n```powershell\nGet-RemoteMessageOptions | Format-Table * -Autosize\n```\n  \n### Get-ComputerSession\n  \nThis Cmdlet allows you to list sessions on the local and remote computers.  \n  \n```powershell\nGet-ComputerSession -ComputerName 'MYQUANTUMCOMPUTER.contoso.com' -ActiveOnly -IncludeSystemSession\n```\n  \n### Send-Click\n  \nSends a click on the current desktop.  \n  \n```powershell\nSend-Click\n```\n  \n### Get-ResourceMessageTable\n  \nThis Cmdlet was designed to retrieve messages stored in a message table, in a file.  \nThese files are usually libraries used by the system, and other applications, for error handling, status and many others.  \nIt is specially useful to build automations for **Microsof Endpoint Configuration Manager**, based on **Status Messages**.  \n  \n```powershell\nGet-ResourceMessageTable -Path 'C:\\Windows\\System32\\kernel32.dll'\n```\n  \n### Get-ErrorString (gerrmess)\n  \nThis Cmdlet retrieves the message for a 'Win32', 'NTSTATUS', 'FDI' and 'FCI' errors\nTrivia: These errors are stored in message tables, inside system DLLs, which you can list with the previous Cmdlet.  \n  \n```powershell\nGet-ErrorString -ErrorCode 5\n\nAccess is denied.\n\n[System.Runtime.InteropServices.Marshal]::GetLastWin32Error() | Get-FormattedError\n```\n  \n### Get-LastWin32Error\n  \nThis Cmdlet returns the last 'Win32' error thrown by the system.  \nDoes the same as the **GetLastWin32Error()** method, from **System.Runtime.InteropServices.Marshal**, but brings the error message instead of the code.  \n  \n```powershell\nGet-LastWin32Error\n```  \n  \n### Get-ObjectHandle (gethandle)\n  \nMy favorite one, and the one I had most fun building.  \nThis Cmdlet was designed to mimic the famous [Handle](https://learn.microsoft.com/en-us/sysinternals/downloads/handle), from Sysinternals.  \nIt shows which process holds a **handle** to a file or directory. This information can be used when you need to modify or delete a file locked by a process.  \nYou can close handles to objects using **-CloseHandle**.  \n  \n```powershell\nGet-ObjectHandle -Path 'C:\\Windows\\System32\\kernel32.dll', 'C:\\Windows\\System32\\ntdll.dll'\nGet-ObjectHandle -Path \"$env:TEMP\\*.tmp\"\n\nGet-ObjectHandle -Path \"${env:ProgramFiles(x86)}\\7-zip\\7-zip.dll\" -CloseHandle\nGet-ObjectHandle -Path \"${env:ProgramFiles(x86)}\\7-zip\\7-zip.dll\" -CloseHandle -Force\n\nGet-ChildItem -Path 'C:\\Windows\\System32' -Filter '*.dll' | Get-ObjectHandle\n\ngethandle -ProcessId 666\nGet-Process -Id 666 | gethandle -All\n\nPS C:\\Windows\\System32\u003e_ Get-ObjectHandle csrss*\n```\n  \n### Get-MsiProperties\n  \nAnother favorite of mine, this Cmdlet get's information about MSI files, from the installer database.  \nThis can also be achieved using the [WindowsInstaller.Installer](https://learn.microsoft.com/en-us/windows/win32/msi/installer-object) object, and in fact, it uses the same object, but called directly via WINAPI.  \n  \n```powershell\nGet-MsiProperties -Path 'C:\\Users\\You\\Downloads\\PowerShell-Installer.msi'\n```\n  \n### Disconnect-Session (disconnect)\n  \nThis Cmdlet disconnects interactive sessions on the local, or remote computers.  \nIt disconnects based on the **SessionId**, which can be obtained with **Get-ComputerSession**.  \n  \n```powershell\nDisconnect-Session -ComputerName 'MYQUANTUMCOMPUTER.contoso.com' -SessionId 3 -Wait\n```\n\n### Remove-Service\n\nThis Cmdlet deletes a service installed in the current or remote computer.\nYou can choose to stop the service, and its dependents to make sure the service is deleted as soon as possible.\nTo remove a service is ultimately to mark it to deletion. The removal might not be instantaneous.\n\n```powershell\n# Removes the service 'MyCoolService'.\nRemove-Service -Name 'MyCoolService'\n\n# Stops the service, and its dependents, and remove it. 'Force' skips confirmation.\nRemove-Service -Name 'MyCoolService' -Stop -Force\n```\n\n### Get-ServiceSecurity\n\nThis Cmdlet gets the security attributes for a service. These include the DACL, and optionally the SACL.\nIt was designed to be familiar with the '*-Acl' Cmdlet series, like `Get-Acl`. In fact, the objects where\ncreated based on the same objects.\n\n```powershell-console\nGet-ServiceSecurity wuauserv | Format-List *\n\nName                    : wuauserv\nAccessToString          : NT AUTHORITY\\Authenticated Users Allow Start, GenericRead\n                          NT AUTHORITY\\SYSTEM Allow AllAccess\n                          BUILTIN\\Administrators Allow AllAccess\nAuditToString           :\nAccess                  : {WindowsUtils.AccessControl.ServiceAccessRule, WindowsUtils.AccessControl.ServiceAccessRule, WindowsUtils.AccessControl.ServiceAccessRule}\nAudit                   : {}\nAccessRightType         : WindowsUtils.Services.ServiceRights\nAccessRuleType          : WindowsUtils.AccessControl.ServiceAccessRule\nAuditRuleType           : WindowsUtils.AccessControl.ServiceAuditRule\nOwner                   : NT AUTHORITY\\SYSTEM\nGroup                   : NT AUTHORITY\\SYSTEM\nSddl                    : O:SYG:SYD:(A;;CCLCSWRPLORC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)\nAreAccessRulesProtected : False\nAreAuditRulesProtected  : False\nAreAccessRulesCanonical : True\nAreAuditRulesCanonical  : True\n```\n\n```powershell-console\nGet-ServiceSecurity wuauserv -Audit | Format-List *\n\nName                    : wuauserv\nAccessToString          : NT AUTHORITY\\Authenticated Users Allow Start, GenericRead\n                          NT AUTHORITY\\SYSTEM Allow AllAccess\n                          BUILTIN\\Administrators Allow AllAccess\nAuditToString           : Everyone Failure ChangeConfig, Start, Stop, PauseContinue, Delete, GenericRead, WriteDac, WriteOwner\nAccess                  : {WindowsUtils.AccessControl.ServiceAccessRule, WindowsUtils.AccessControl.ServiceAccessRule, WindowsUtils.AccessControl.ServiceAccessRule}\nAudit                   : {WindowsUtils.AccessControl.ServiceAuditRule}\nAccessRightType         : WindowsUtils.Services.ServiceRights\nAccessRuleType          : WindowsUtils.AccessControl.ServiceAccessRule\nAuditRuleType           : WindowsUtils.AccessControl.ServiceAuditRule\nOwner                   : NT AUTHORITY\\SYSTEM\nGroup                   : NT AUTHORITY\\SYSTEM\nSddl                    : O:SYG:SYD:(A;;CCLCSWRPLORC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)S:(AU;FA;CCDCLCSWRPWPDTLOSDRCWDWO;;;WD)\nAreAccessRulesProtected : False\nAreAuditRulesProtected  : False\nAreAccessRulesCanonical : True\nAreAuditRulesCanonical  : True\n```\n\n### New-ServiceAccessRule\n\nThis Cmdlet creates a service access rule (DACL) used to change service security.\nYou can use the new access rule with `Set-ServiceSecurity`.\n\n```powershell-console\nNew-ServiceAccessRule -Identity 'NT AUTHORITY\\SYSTEM' -Rights 'ChangeConfig' -Type 'Allow' -InheritanceFlags 'ObjectInherit' -PropagationFlags 'InheritOnly'\n\nServiceRights     : ChangeConfig\nAccessControlType : Allow\nIdentityReference : NT AUTHORITY\\SYSTEM\nIsInherited       : False\nInheritanceFlags  : ObjectInherit\nPropagationFlags  : InheritOnly\n```\n\n### New-ServiceAuditRule\n\nThis Cmdlet creates a service audit rule (SACL) used to change service security.\nYou can use the new audit rule with `Set-ServiceSecurity`.\n\n```powershell-console\nNew-ServiceAuditRule -Identity 'NT AUTHORITY\\SYSTEM' -Rights 'EnumerateDependents' -Flags 'Failure'\n\nServiceRights     : EnumerateDependents\nAuditFlags        : Failure\nIdentityReference : NT AUTHORITY\\SYSTEM\nIsInherited       : False\nInheritanceFlags  : None\nPropagationFlags  : None\n```\n\n### Set-ServiceSecurity\n\nThis Cmdlet changes service security. It was designed to work like the `Set-Acl` Cmdlet.\nYou typically use this Cmdlet with the other service security commands.\n\n```powershell\n$serviceSecurity = Get-ServiceSecurity -Name test_service\n$newRule = New-ServiceAccessRule -Identity 'CONTOSO\\User' -Rights 'EnumerateDependents' -Type 'Allow'\n$serviceSecurity.AddAccessRule($newRule)\nSet-ServiceSecurity -Name test_service -SecurityObject $serviceSecurity\n```\n\n### Get-InstalledDotnet (getdotnet)\n\nThis Cmdlet returns all .NET versions installed in the computer. Additionally, you can return\nthe installed patches for .NET.\n\n```powershell-console\nGet-InstalledDotnet\n\nVersion        Edition ComputerName\n-------        ------- ------------\n4.8.9032 FullFramework MYCOMPUTERNAME\n```\n\n```powershell-console\nGet-InstalledDotnet -InlcudeUpdate | Select-Object -ExpandProperty InstalledUpdates\n\nVersion                                   InstalledUpdates                                ComputerName\n-------                                   ----------------                                ------------\nMicrosoft .NET Framework 4 Client Profile {KB2468871, KB2468871v2, KB2478063, KB2533523…} MYCOMPUTERNAME\nMicrosoft .NET Framework 4 Extended       {KB2468871, KB2468871v2, KB2478063, KB2533523…} MYCOMPUTERNAME\n```\n\n### Expand-Cabinet\n\nThis Cmdlet extracts files from a cabinet file.\nThis Cmdlet is provider-aware.\n\n```powershell\n# Extracts files from 'Cabinet.cab' to the 'Destination' folder.\nExpand-Cabinet -Path \"$env:SystemDrive\\Path\\To\\Cabinet.cab\" -Destination \"$env:SystemDrive\\Path\\To\\Destination\"\n\n# Extract files from all cabinet files from 'C:\\CabinetSource' that matches 'MultipleCab*'.\nGet-ChildItem -Path 'C:\\CabinetSource\\MultipleCab*' | Expand-Cabinet -Destination 'C:\\Path\\To\\Destination'\n```\n\n### Start-Tcping (tcping)\n\nThis Cmdlet attempts to measure network statistics while connecting to a destination using TCP.\nIt works similarly as well-known tools like 'ping.exe', or 'tcping.exe'.\nThe parameters contain aliases that mimic the parameter in those applications.\n\n```powershell-console\nStart-Tcping -Destination learn.microsoft.com  -Port 443 -IncludeJitter\n\nDestination                    Port  Status  Times\n-----------                    ----  ------  -----\nlearn.microsoft.com            443   Open    Rtt: 7.14\nlearn.microsoft.com            443   Open    Rtt: 8.50, Jitter: 1.36\nlearn.microsoft.com            443   Open    Rtt: 9.50, Jitter: 1.68\nlearn.microsoft.com            443   Open    Rtt: 7.59, Jitter: 0.79\n\nSent          : 4\nSucceeded     : 4\nFailed        : 0\nFailedPercent : 0.00%\nMinTimes      : Rtt: 7.59, Jitter: 0.79\nAvgTimes      : Rtt: 8.18, Jitter: 1.28\nMaxTimes      : Rtt: 9.50, Jitter: 1.68\n```\n\n```powershell-console\ntcping learn.microsoft.com, google.com -Port 80, 443 -s\n\nDestination                    Port  Status  Times\n-----------                    ----  ------  -----\nlearn.microsoft.com            80    Open    Rtt: 8.32\nlearn.microsoft.com            443   Open    Rtt: 19.91\ngoogle.com                     80    Open    Rtt: 9.57\ngoogle.com                     443   Open    Rtt: 7.01\n```\n\n### Start-ProcessAsUser (runas)\n\nThis Cmdlet logs in a user and starts a process with it.\nThis is my terrible attempt to reverse engineer 'runas.exe'.\nIt works by typing the credentials in the go, like 'runas.exe', or using\na `PSCredential`.\n\n```powershell\nStart-ProcessAsUser CONTOSO\\francisco.nabas powershell\n```\n\nOf course we have an alias for it.\n\n```powershell\nrunas -CommandLine powershell -Credential (Get-Credential)\n```\n\n### Get-NetworkFile (psfile, getnetfile)\n\nThis Cmdlet lists all files opened through the network on the current or remote computer.\nIt was designed to mimic `psfile.exe` from Sysinternals.\n\n```powershell-console\nGet-NetworkFile -ComputerName CISCOSRVP01P\n\nId Path                                                      LockCount UserName        Permissions\n-- ----                                                      --------- --------        -----------\n8  C:\\                                                       0         francisco.nabas Read\n14 C:\\Program Files                                          0         francisco.nabas Read\n18 C:\\Program Files\\Microsoft Analysis Services              0         francisco.nabas Read\n24 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n25 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n28 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n29 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n40 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n43 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n56 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n59 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n60 \\srvsvc                                                   0         francisco.nabas Read, Write, ChangeAttribute\n```\n\n```powershell-console\npsfile CISCOSRVP01P -IncludeConnectionName | Select-object * -First 1\n\nComputerName : CISCOSRVP01P\nSessionName  : 10.21.13.152\nUserName     : francisco.nabas\nLockCount    : 0\nPermissions  : Read\nPath         : C:\\\nId           : 8\n```\n\n```powershell-console\npsfile CISCOSRVP01P -BasePath 'C:\\Program Files\\Microsoft Analysis Services'\n\nId Path                                                      LockCount UserName        Permissions\n-- ----                                                      --------- --------        -----------\n18 C:\\Program Files\\Microsoft Analysis Services              0         francisco.nabas Read\n24 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n25 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n28 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n29 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n40 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n43 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n59 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n```\n\n```powershell-console\ngetnetfile CISCOSRVP01P -UserConnectionFilter 'francisco.nabas'\n\nId Path                                                      LockCount UserName        Permissions\n-- ----                                                      --------- --------        -----------\n8  C:\\                                                       0         francisco.nabas Read\n14 C:\\Program Files                                          0         francisco.nabas Read\n18 C:\\Program Files\\Microsoft Analysis Services              0         francisco.nabas Read\n24 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n25 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n28 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n29 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n40 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n43 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB     0         francisco.nabas Read\n59 C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140 0         francisco.nabas Read\n64 \\srvsvc                                                   0         francisco.nabas Read, Write, ChangeAttribute\n```\n\n### Close-NetworkFile (closenetfile)\n\nThis Cmdlet closes files opened through the network on the local or remote computer.\nIt was designed to work in conjunction with `Get-NetworkFile`.\nIt is also based on `psfile.exe`, from Sysinternals.\n\n```powershell-console\nGet-NetworkFile -ComputerName CISCOSRVP01P\n\nId  Path                                                                                                                    LockCount UserName        Permissions\n--  ----                                                                                                                    --------- --------        -----------\n24  C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB                                                                   0         francisco.nabas Read\n25  C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB                                                                   0         francisco.nabas Read\n28  C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140                                                               0         francisco.nabas Read\n29  C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140                                                               0         francisco.nabas Read\n59  C:\\Program Files\\Microsoft Analysis Services\\AS OLEDB\\140                                                               0         francisco.nabas Read\n140 C:\\Windows\\SYSVOL\\sysvol\\nabas.com\\Policies\\{31B2F340-016D-11D2-945F-00C04FB984F9}\\Machine                              0         CISCOCS01P$     Read\n141 C:\\Windows\\SYSVOL\\sysvol\\nabas.com\\Policies\\{31B2F340-016D-11D2-945F-00C04FB984F9}\\Machine\\Microsoft                    0         CISCOCS01P$     Read\n142 C:\\Windows\\SYSVOL\\sysvol\\nabas.com\\Policies\\{31B2F340-016D-11D2-945F-00C04FB984F9}\\Machine\\Microsoft\\Windows NT         0         CISCOCS01P$     Read\n143 C:\\Windows\\SYSVOL\\sysvol\\nabas.com\\Policies\\{31B2F340-016D-11D2-945F-00C04FB984F9}\\Machine\\Microsoft\\Windows NT\\SecEdit 0         CISCOCS01P$     Read\n147 \\srvsvc\n\nClose-NetworkFile -ComputerName CISCOSRVP01P -FileId 24\n```\n\n```powershell\ngetnetfile CISCOSRVP01P | ? UserName -eq 'francisco.nabas' | closenetfile -Force\n```\n\n### New-Cabinet\n\nThis Cmdlet creates a new cabinet based on a source path. It must be a valid path to a file or folder.\nIf the path is a folder, it will search for files recursively, and compress them.\nCabinet files only accept files up to 2Gb of length, and the maximum size for a cabinet is also 2Gb.\n\n```powershell\nNew-Cabinet -Path 'C:\\Path\\To\\Files' -Destination 'C:\\Path\\To\\Destination'\n```\n\nYou can also limit the size of the cabinet, in kilobytes. If the files surpass this limit they will span over multiple files\n\n```powershell\nNew-Cabinet -Path 'C:\\Path\\To\\Files' -Destination 'C:\\Path\\To\\Destination' -MaxCabSize 20000\n```\n\n### Test-Port (testport)\n\nThis Cmdlet tests if a TCP or UDP port is open in a given destination.\nAttention! Due to the nature of UDP packets, `Test-Port` might return false positive if a timeout occur when testing against public domains, like 'google.com'.\nUPD testing is better used with LAN servers.\n\n```powershell\nTest-Port -ComputerName 'google.com' -TcpPort 80\n```\n\n```powershell\ntestport 'SUPERSERVER.contoso.com' 443\n```\n\n```powershell\ntestport 'SUPERSERVER1.contoso.com', 'SUPERSERVER2.contoso.com' -TcpPort 80, 443, 1433 -UdpPort 67, 68, 69, 4011\n```\n\n### Get-ProcessModule (listdlls)\n\nThis Cmdlet lists modules loaded into processes. You can list modules for one or more processes, or all of them.\nYou can also include module file version information (with a performance penalty).\n\n```powershell\nGet-ProcessModule -Name 'explorer'\n```\n\n```powershell\nlistdlls -ProcessId 666, 667 -IncludeVersionInfo\n```\n\n```powershell\nlistdlls\n```\n\n### Suspend-Process (suspend)\n\nThis Cmdlet suspends a running process.\n\n```powershell\nSuspend-Process -Name 'notepad'\n```\n\n```powershell\nsuspend -Id 666\n```\n\n### Resume-Process (resume)\n\nThis Cmdlet resumes a suspended process. It does nothing on running processes.\n\n```powershell\nResume-Process -Name 'notepad'\n```\n\n```powershell\nresume -Id 666\n```\n\n### Get-ErrorInformation (err)\n\nThis Cmdlet mimics 'Err.exe'. In fact, the error database is extracted from it.\n\n```powershell\nGet-ErrorInformation -ErrorCode 0xC0000008\n```\n\n```powershell-console\nerr 0x80070057\n\nErrorCode   HexCode    IsHResult SymbolicName               Description\n---------   -------    --------- ------------               -----------\n-2147024809 0x80070057 True      XNS_INTERNAL_ERROR\n-2147024809 0x80070057 False     COR_E_ARGUMENT             An argument does not meet the contract of the method.\n-2147024809 0x80070057 False     DDERR_INVALIDPARAMS\n-2147024809 0x80070057 False     DIERR_INVALIDPARAM\n-2147024809 0x80070057 False     DSERR_INVALIDPARAM\n-2147024809 0x80070057 True      NMERR_FRAME_HAS_NO_CAPTURE\n-2147024809 0x80070057 False     STIERR_INVALID_PARAM\n-2147024809 0x80070057 False     DRM_E_INVALIDARG\n-2147024809 0x80070057 True      ERROR_INVALID_PARAMETER    The parameter is incorrect.\n-2147024809 0x80070057 False     E_INVALIDARG               One or more arguments are invalid\n-2147024809 0x80070057 True      LDAP_FILTER_ERROR\n```\n\n### Get-MsiSummaryInfo\n\nThis Cmdlet gets the summary information from a Windows Installer.\nSummary data contains information about the author, languages, platforms, creation time, UAC compliance and more.\n\n```powershell\nGet-MsiSummaryInfo -Path 'C:\\Path\\To\\Installer.msi'\n```\n\n### Get-MsiTableInfo\n\nThis Cmdlet gets table information from a Windows Installer's database.\nYou can list information about a single table, multiple tables, or all tables in the database. Contains the table name and column information,\nlike type, position, if it's key, nullable, etc.\n\n```powershell\nGet-MsiTableInfo -Path 'C:\\Path\\To\\Installer.msi' -Table 'Feature', 'Registry'\n```\n\n```powershell\nGet-MsiTableInfo 'C:\\Path\\To\\Installer.msi'\n```\n\n### Get-MsiTableData\n\nThis Cmdlet gets the data from a table in a Windows Installer's Database.\nThis works for built-in, and custom tables.\n\n```powershell\nGet-MsiTableData -Path 'C:\\Path\\To\\Installer.msi' -Table 'Feature', 'Registry'\n```\n\n```powershell\nGet-MsiTableData 'C:\\Path\\To\\Installer.msi' 'Feature'\n```\n\n```powershell\nGet-MsiTableInfo -Path 'C:\\Path\\To\\Installer.msi' -Table 'Feature', 'Registry' | Get-MsiTableData\n```\n\n### Invoke-MsiQuery (imsisql)\n\nThis Cmdlet executes a query in a Windows Installer MSI database.\nATTENTION! The SQL language used in the installer database is quite finicky. Be sure to check the notes, and related links for more information.\nYou can reach that information with `Get-Help Invoke-MsiQuery -Full`.\n\n```powershell\nInvoke-MsiQuery -Path 'C:\\SuperInstaller.msi' -Query 'SELECT * FROM Registry' | Format-Table -AutoSize\n```\n\n```powershell\nInvoke-MsiQuery 'C:\\SuperInstaller.msi' \"INSERT INTO Registry (Registry, Root, ``Key``, Name, Value, Component_) VALUES ('NeatNewKey', 0, 'SOFTWARE\\NeatKey', 'NeatKey', 'KeyValue', 'KeyComponent')\"\n```\n\n```powershell\n$parameter = [WindowsUtils.Installer.InstallerCommandParameter]::new('String', 'ProductCode')\nimsisql 'C:\\SuperInstaller.msi' 'Select * From Property Where Property = ?' -Parameters $parameter\n```\n\n```powershell\n$parameter = [WindowsUtils.Installer.InstallerCommandParameter]::new('File', 'C:\\Path\\To\\InstallerIcon.ico')\nimsisql 'C:\\SuperInstaller.msi' \"INSERT INTO Icon (Name, Data) VALUES ('IconName', ?)\" -Parameters $parameter\n```\n\n## Changelog\n  \nVersioning information can be found on the [Changelog](https://github.com/FranciscoNabas/WindowsUtils/blob/main/CHANGELOG.md) file.  \nChangelogging began at version 1.3.0, because I didn't keep track before that.  \n  \n## Support\n  \nNo way you made it down here LOL.  \nIf you have an idea, or a solution you'd like to have in PowerShell, Windows-related, regardless of how absurd it might sound, let me know. I'd love to try it.  \nThis is a module from a Sysadmin to Sysadmins, if you know how to program using C++/CLI and C#, and want to contribute, fork it!  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFranciscoNabas%2FWindowsUtils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFranciscoNabas%2FWindowsUtils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFranciscoNabas%2FWindowsUtils/lists"}