File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ function Connect-Neocities
2
+ {
3
+ <#
4
+ . SYNOPSIS
5
+ Connect to Neocities
6
+ . DESCRIPTION
7
+ Connect to Neocities using a credential object.
8
+
9
+ This will create a session that can be used to authenticate to the Neocities API.
10
+ . LINK
11
+ Get-Neocities
12
+ #>
13
+ param (
14
+ # The Neocities credential
15
+ [Parameter (ValueFromPipelineByPropertyName )]
16
+ [Alias (
17
+ ' Credentials' , # Plural aliases are nice
18
+ ' PSCredential' , # so are parameters that match the type name.
19
+ ' NeocitiesCredential' , # A contextual alias is a good idea, too.
20
+ ' NeocitiesCredentials' # And you may need to pluralize that contextual alias.
21
+ )]
22
+ [PSCredential ]
23
+ $Credential
24
+ )
25
+
26
+ begin {
27
+ $NeocitiesApi = " https://neocities.org/api"
28
+ }
29
+
30
+ process {
31
+ Invoke-RestMethod - Uri ($NeocitiesApi , ' key' -join ' /' ) - Credential $Credential - Authentication Basic
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments