private/Find-ArticleUri.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function Find-ArticleUri {

    [CmdletBinding()]
        Param(
            [Parameter(
                HelpMessage = "Microsoft KnowledgeBase (KB) article Id.",
                Mandatory,
                Position = 0,
                ValueFromPipeline,
                ValueFromPipelineByPropertyName
            )]
            [Alias( 'id', 'KBId' )]
            [String[]] $articleId
        )

    Begin {
        # Endpoint for searching article by its ID
        $updateCatalogSearchLink =   'http://www.catalog.update.microsoft.com/Search.aspx?q=KB{0}'
    }

    Process {
        foreach ($id in $articleId) {
            $updateCatalogSearchLink -f $id
        }
    }

    End {}

}