Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RamblingCookieMonster/PSStackExchange
PowerShell module to query Stack Exchange API
https://github.com/RamblingCookieMonster/PSStackExchange
powershell powershell-modules stackoverflow
Last synced: 4 days ago
JSON representation
PowerShell module to query Stack Exchange API
- Host: GitHub
- URL: https://github.com/RamblingCookieMonster/PSStackExchange
- Owner: RamblingCookieMonster
- License: mit
- Created: 2015-08-02T23:19:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-26T22:42:18.000Z (over 8 years ago)
- Last Synced: 2024-10-28T10:02:14.915Z (14 days ago)
- Topics: powershell, powershell-modules, stackoverflow
- Language: PowerShell
- Homepage: http://ramblingcookiemonster.github.io/Building-A-PowerShell-Module
- Size: 50.8 KB
- Stars: 80
- Watchers: 8
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - RamblingCookieMonster/PSStackExchange - PowerShell module to query Stack Exchange API (PowerShell)
README
[![Build status](https://ci.appveyor.com/api/projects/status/xyl9iyopvbucvpbi/branch/master?svg=true)](https://ci.appveyor.com/project/RamblingCookieMonster/psstackexchange/branch/master)
PSStackExchange
=============This is a rudimentary PowerShell module for querying the [Stack Exchange API](https://api.stackexchange.com/docs), written to illustrate [a basic PowerShell module organization and workflow](http://ramblingcookiemonster.github.io/Building-A-PowerShell-Module).
This is not fully featured or tested, but pull requests would be welcome!
#Instructions
```powershell
# One time setup
# Download the repository
# Unblock the zip
# Extract the PSStackExchange folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)#Simple alternative, if you have PowerShell 5, or the PowerShellGet module:
Install-Module PSStackExchange# Import the module.
Import-Module PSStackExchange #Alternatively, Import-Module \\Path\To\PSStackExchange# Get commands in the module
Get-Command -Module PSStackExchange# Get help
Get-Help Get-SEObject -Full
Get-Help about_PSStackExchange
```#Examples
### Find Stack Exchange Sites and Urls
```PowerShell
# Find Stack Exchange sites and urls
Get-SEObject -Object Sites |
Sort -Property api_site_parameter |
Select -Property api_site_parameter, site_url
```![Get Sites](/Media/Get-SEObject.png)
### Search Stack Exchange Questions
```PowerShell
# Search questions on stack overflow, tagged PowerShell, with System.DBNull in the title
Search-SEQuestion -Title System.DBNull -Tag PowerShell -Site StackOverflow# Search questions on ServerFault
# Posted by User with ID 105072
# With PowerShell in the Title
# Without the tag windows-server-2008-r2
Search-SEQuestion -User 105072 `
-Site ServerFault `
-ExcludeTag 'windows-server-2008-r2' `
-Title PowerShell
```![Search Questions](/Media/Search-SEQuestion.png)