使用PowerShell获取在Blogger站点中发布的所有帖子的标题和发布日期

时间:2013-06-13 17:20:26

标签: arrays powershell

如何使用 Invoke-WebRequest 将所有博客发布到博主网站上?谁能帮助我?

我做了所有这些但是无法获得输出

$r = Invoke-WebRequest -Uri "www.vinithmenon.com"
$r
$r.AllElements
$r.AllElements | gm
$r.AllElements.innerhtml[0]
$new = $r.AllElements
$new
$new.innerhtml
$new.innerhtml[0]
$new | gm
$new.outerhtml | select -First 1
$new.outerhtml | select -First 1 | gm
$new.innerhtml | select -First 1 | gm
$new | gm
$new | select tagname |select -First 1
$new | select innertext |select -First 1
$new.innertext |select -First 1
$new | gm
$new.innerhtml |select -First 1
$new.innerhtml |select -First 1 | gm
$new | gm
$new.outerhtml |select -First 1 | gm
$new | gm
$new.tagname |select -First 1 | gm

2 个答案:

答案 0 :(得分:1)

您正在查看错误的网址。查看RSS提要URL。

Invoke-RestMethod -Uri http://www.vinithmenon.com/feeds/posts/default

现在,探索标题等属性

答案 1 :(得分:0)

这给了我最后的所有结果

PS C:\Users\Vinith> ([xml](invoke-webrequest 'http://www.vinithmenon.com/feeds/posts/default')).feed.entry.title.'#text'
 | Measure-Object


Count    : 25

PS C:\Users\Vinith> ([xml](invoke-webrequest 'http://www.vinithmenon.com/feeds/posts/default')).feed.entry.title.'#text'

Presenting at PowerShell Bangalore User Group Meeting, June 1st 2013
Provision Virtual Machines in Parallel using New Workflow Feature in PowerShell V3
Running SharePoint 2010 PowerShell  cmdlets on Windows Server 2012
Convert a Windows Server 2012 Server to iSCSI Target Server And Offer Low-Cost Storage
PowerShell Script to Check if Windows 8 PC is complaint to run Hyper-V V-3
New iSCSI cmdlets in PowerShell V3 Part - 1
Delegated Administration in Windows PowerShell v3
Switching Over From PowerShell V2 to V3 in Same PowerShell Console
Setting Default Parameters using $PSDefaultParameterValues in PowerShell V3
Ordered Hash Tables in Windows PowerShell V3.
New CIM Cmdlets in PowerShell V3
PowerShell WebAccess, Web-Based Windows PowerShell Console
Unblock Files Using PowerShell v3 "Unblock-File" cmdlet
Converting between GUI and Server Core in Windows Server 2012 Using PowerShell V3
Manipulating SharePoint Lists using PowerShell
Set Permissions on a File or Directory using PowerShell
Using Performance Counter with PowerShell to Extract Server Uptime
Customizing PowerShell Prompt via $Profile
PowerShell Script to Automate Virtual Machine Provisioning using Hyper-V Version 3 Cmdlets in Windows Server 2012
  PowerShell Script to configure iSCSI Network Cards as per Microsoft Best Practices.
PowerShell V3 Scheduled Job to start iSCSI service for Hyper-V Server
PowerShell Script for Automated Install of Hyper-V Integration Services in a VM running on Windows Server 2012 with Hyp
er-V V 3.0 Role using PowerShell Remoting
Get VM Creation Metrics Using SCVMM PowerShell Cmdlets
Extract MPIO.SYS and MSISCSI.SYS File Information across Virtual Machine's and Hyper-V Hosts Using PowerShell SCVMM Cmd
lets