< Back

Get-PNews

Sat Jan 18, 2020 7:28 pm

NAME Get-PNews



SYNOPSIS

Returns the Populi news feed, ordered most recent to least recent (with pinned articles at the top).





SYNTAX

Get-PNews [-PopuliUri] <String> [-PopuliAuthkey] <String> [-Limit <Int32>] [-Offset <Int32>] [<CommonParameters>]





DESCRIPTION

The content element contains HTML, with embedded media links resolved absolutely (so no additional parsing should

be necessary).

Here is an example to help you access the html in the content section:

$NewsData = Get-PNews -PopuliUri $PopuliUri -PopuliAuthkey $PopuliAuthkey -Limit 5

foreach ($Item in $NewsData) {

$Title = $Item.title

$Content = $Item.content.'#cdata-section'

}





PARAMETERS

-PopuliUri <String>

Set to the correct URL for your college (i.e. https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/).

This parameter is required.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PopuliAuthkey <String>

The authentication key with necessary permissions for the data you are requesting.

You must have the Staff role to call this task.

This parameter is required.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Limit <Int32>

The maximim number of articles you'd like returned (defaults to 10).



Required? false

Position? named

Default value 10

Accept pipeline input? false

Accept wildcard characters? false



-Offset <Int32>

If a limit is specified, you can also specify an offset.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Returns PowerShell objects:

ArticleId

Title

Content

Pinned

PinnedUntil

AddedAt

AddedBy

AddedByName

UpdatedAt

UpdatedBy

UpdatedByName

RoleId

RoleName





NOTES





Author: Matthew Rehm

Creation Date: 12/11/2018



-------------------------- EXAMPLE 1 --------------------------



Get-PNews -PopuliUri 'https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/ -PopuliAuthkey '123456789' -Limit 5













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>#Store your Populi Credentials in a hash table:



$PopuliCredentials = @{

PopuliURI = https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/

PopuliAuthkey = '1ReallyLongAlphaNumericSequence'

}

Get-PNews @PopuliCredentials











RELATED LINKS