![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | NotImplementedException - The method or operation is not implemented i jusy downloaded PowerShell CTP 2.0 and I'm fairly new to it so bare with me please. i'm getting a "System.NotImplementedException The method or operation is not implemented" while trying the following piece of code [System.Reflection.Assembly]::Load("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") trap [Exception]{ write-host write-error $("TRAPPED: " + $_.Exception.GetType().FullName); write-error $("TRAPPED: " + $_.Exception.Message); continue; } $xmlDoc=new-object System.Xml.XmlDocument $xmlDoc.PreserveWhitespace = true; $xmlDoc.Load("D:\Stuff\Other Files\create.xml"); $xmlSignElt=$xmlDoc.GetElementsByTagName("sign") # statement on which it's choking ... I assume,from the exception message that the GetElementsByTagName is not implemented in PowerShell but how come i can use other functions from the same class this method exists in ? Aren't all the .NET namespaces available for use inside PS scripts? If not, how do i know which methods are available and which are not? i'm using .NET 2.0 |
| | #2 (permalink) | ||||||||||||
| Guest | Re: NotImplementedException - The method or operation is not implemented
and/or provide your create.xml contents for us to test if you can. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: NotImplementedException - The method or operation is notimplemented On May 13, 5:03 pm, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote:
it's working now sorry my mistake, it was breaking while trying to access the XmlNodeList , i apparently was doing it the wrong way ![]() i'm having another exception now, first let me explain what i'm trying to do . My target is to encypt some elements of an XML file with an asymetric key. if ($elementToEncrypt -eq $null){ throw (new-object System.Xml.XmlException("The specified element was not found")) } $sessionKey = $null #Create a 256 bit Rijndael key. $sessionKey = new-object System.Security.Cryptography.RijndaelManaged $sessionKey.KeySize = 256 $edElement = new-object System.Security.Cryptography.Xml.EncryptedData write-host $("elementToEncrypt is null? " + ($elementToEncrypt -eq $null)) $encryptedXml = new-object System.Security.Cryptography.Xml.EncryptedXml $encryptedElement = $encryptedXml.EncryptData($elementToEncrypt, $sessionKey, $false) write-host $("encryptedElement is null? " + ($encryptedElement -eq $null)) $edElement.Type = $encryptedXml.XmlEncElementUrl $edElement.Id = $EncryptionElementID $edElement.EncryptionMethod = new-object System.Security.Cryptography.Xml.EncryptionMethod($encryptedXml.XmlEncAES256Url); # Encrypt the session key and add it to an EncryptedKey element. $ek = new-object System.Security.Cryptography.Xml.EncryptedKey [byte[]] $encryptedKey = [System.Security.Cryptography.Xml.EncryptedXml]::EncryptKey($sessionKey.Key, $Alg, $false); $ek.CipherData = new-object System.Security.Cryptography.Xml.CipherData($encryptedKey); and the last line is giving the following error when executed "Cannot find an overload for ".ctor" and the argument count: "128"." by the way i had to work my brains out into finding the line spitting the error since the error message and the StackTrace do not mention it as far as i saw thanks again. Oh one more thing! Is there an editor,preferably a free one, other than VS that i can use for writing PS scripts. I tried using the PS Graphical editor but it's nothing more than a syntax coloring tool and an execution environment. | ||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: NotImplementedException - The method or operation is not implemented Honestly, what you're doing is a bit beyond what I currently understand.
http://msdn.microsoft.com/en-us/libr...ipherdata.aspx How are you defining $encryptedkey? You don't have that part in your post.
Marco | ||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WOW! try/catch/finally has been implemented and will be available in next drop. | Roman Kuzmin | PowerShell | 5 | 04-02-2008 08:06 PM |
| Method invocation failed because [System.String] doesn't contain a method | B Williams | PowerShell | 0 | 03-31-2008 06:00 PM |
| Autosave in Spider Solitaire incorrectly implemented | Leighton | Vista Games | 0 | 11-15-2007 09:59 AM |
| HTTP 501 Not Implemented | RRTest | Vista General | 2 | 03-10-2007 09:34 AM |
| OT: Why Aero was implemented on 3D? | Fernando | Vista General | 9 | 07-27-2006 05:43 PM |