This is my first post. I have used the ActivexPosh.dll with from within a scripting language for a variety of tasks in Powershell 2.0. I wanted to test it on Win7 with 3.0 - one simple script had a function within a function
function Get-HtmlTable { param ( [Parameter(ValueFromPipeLineByPropertyName)] $ParsedHtml )
Process { $ParsedHtml.getElementsByTagName("table") | Where classname -eq 'wikitable' } }
and work fine from Powershell and Powershell_ise, but when called from ActivePosh error that line 4 requires an "=" after a named paremeter.
Another script:
# Return the results from the ApprovedEvents service $url = "http://www.communitymegaphone.com/ws/CM ... 20eq%20'VA'" $client = new-object net.webclient <#Data will be returned as JSON, however if youcomment out the client.Headers the data will bereturned as XML#>$client.Headers.Add("accept", "application/json") $s = $client.DownloadString($url)$s | ConvertFrom-JSON
worked (not that well) from PS and ISE, but when run from ActivePosh the error was "ConvertFrom-JSON is not recognized as a cmdlet".
As I am a newbie these could be dumb mistakes on my part, but are there any issues with the dll and version 3.0?
TIA
Stan
ActivePosh and Powerpoint 3.0
ActivePosh and Powerpoint 3.0
I found that by changing
[Parameter(ValueFromPipeLineByPropertyName)]
to [Parameter(ValueFromPipeLineByPropertyName=$true)] I get over that error (although it still works w.out -$true when run directly from PS 3.0).
I still cannot use any of the new cmdlets, viz. Invoke-WebRequest with ActivexPosh, getting a 'cmdlet not found' error, but again all work when called from 3.0 directly.
What can I try?
[Parameter(ValueFromPipeLineByPropertyName)]
to [Parameter(ValueFromPipeLineByPropertyName=$true)] I get over that error (although it still works w.out -$true when run directly from PS 3.0).
I still cannot use any of the new cmdlets, viz. Invoke-WebRequest with ActivexPosh, getting a 'cmdlet not found' error, but again all work when called from 3.0 directly.
What can I try?
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
ActivePosh and Powerpoint 3.0
PowerShell 3 is not released. Not even complete yet. I would go and ask Microsoft why there are compatibility issues. My guess is that with a host built against a prior version of PowerShell you can't use the new cmdlets.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
ActivePosh and Powerpoint 3.0
It's a CTP. Not a release.
"This software is a pre-release version. Features and behavior are likely to change before the final release.
This preview release is designed to enable the community to experience and review the preliminary designs and direction of key features Windows PowerShell 3.0 and to solicit feedback before features are finalized."
"This software is a pre-release version. Features and behavior are likely to change before the final release.
This preview release is designed to enable the community to experience and review the preliminary designs and direction of key features Windows PowerShell 3.0 and to solicit feedback before features are finalized."
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
ActivePosh and Powerpoint 3.0
Understood... sorry. I did notice about 1500 bug reports. I guess I got a little excited about the Json stuff.