locked
Extract a Zip on SurfaceRT without shell.application or System.IO.FileInfo RRS feed

  • Question

  • Hi,

    I originally posted this in the PowerShell forum but have since been asked to post it here :o)  ( http://social.technet.microsoft.com/Forums/windowsserver/en-US/c20a80b2-e00a-4fd8-8a40-1ce74568e8cd/extract-a-zip-on-surfacert-without-shellapplication-or-systemiofileinfo?prof=required )

    I’m currently in the process of setting up some management scripts for SurfaceRT. I know it’s aimed/designed at the home market so understand something’s just aren’t going to work (but when you've got 200+ anything you can do is a bonus!!!).

    I’ve setup a script to download a zip file via bits and was hoping to then extract it contents. I’m hitting a brick wall and hoping someone know how to do this without using either the com or System.IO methods below which don’t work on RT :/

    $shell = new-object -com shell.application
    new-object : Cannot create type. Only core types are supported in this language mode.

    or

    $zip = get-item C:\Users\User\AppData\Local\Temp\system.zip #TypeName: System.IO.FileInfo $zip.open()

    Cannot invoke method. Method invocation is supported only on core types in this language mode.

    If anyone knows another way I'd love to hear from you!!! :o)

    Thanks,

    John

    As a side note if anyone is interested I’ve also found I can't use the following namespaces ...

    Cannot invoke method. Method invocation is supported only on core types in this language mode.
    +         $User = [Security.Principal.WindowsIdentity]::GetCurrent()


    New-Object : Cannot create type. Only core types are supported in this language mode.
    +         $Role = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Secur ...


    New-Object : Cannot create type. Only core types are supported in this language mode.
    +         $objServiceManager = New-Object -ComObject "Microsoft.Update.ServiceManager"


    New-Object : Cannot create type. Only core types are supported in this language mode.
    +         $objSession = New-Object -ComObject "Microsoft.Update.Session"

    • Moved by CoolDadTx Tuesday, August 6, 2013 2:59 PM WinRT related
    Monday, August 5, 2013 2:39 PM

Answers

  • Unfortunately, this forum is for developing Windows Store apps, not powershell.  It actually does belong on the Powershell forum, since Windows Rt should act the same as Windows 8 in this regard (I believe).This forum does not have the experience that you are looking for in order to answer this question.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, August 7, 2013 4:07 PM
    Moderator
  • Hi John,

    As noted in your original post, PowerShell is limited in what it can call on Window RT. For more information on that please follow up on your original post in the PowerShell forum. Windows RT cannot run custom desktop applications (such as the 7-zip executable you were directed at), only the built in ones. I don't believe there is a scriptable unzip application on Windows RT. The TechNet forums you posted in would be the appropriate places to discuss that.

    From a programmatic standpoint, Windows RT supports only Windows Store apps (the subject of the Building Windows Store apps with C# or VB forum), which are not generally appropriate for management tasks. They are locked down and cannot affect the system as a whole. If you want to write a Windows Store app to manipulate zip files take a look at the ZipArchive class.

    --Rob

    Wednesday, August 7, 2013 7:03 PM
    Moderator

All replies

  • Unfortunately, this forum is for developing Windows Store apps, not powershell.  It actually does belong on the Powershell forum, since Windows Rt should act the same as Windows 8 in this regard (I believe).This forum does not have the experience that you are looking for in order to answer this question.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, August 7, 2013 4:07 PM
    Moderator
  • Hi John,

    As noted in your original post, PowerShell is limited in what it can call on Window RT. For more information on that please follow up on your original post in the PowerShell forum. Windows RT cannot run custom desktop applications (such as the 7-zip executable you were directed at), only the built in ones. I don't believe there is a scriptable unzip application on Windows RT. The TechNet forums you posted in would be the appropriate places to discuss that.

    From a programmatic standpoint, Windows RT supports only Windows Store apps (the subject of the Building Windows Store apps with C# or VB forum), which are not generally appropriate for management tasks. They are locked down and cannot affect the system as a whole. If you want to write a Windows Store app to manipulate zip files take a look at the ZipArchive class.

    --Rob

    Wednesday, August 7, 2013 7:03 PM
    Moderator