# Decipher powershell script line

**URL:** <https://forums.powershell.org/t/decipher-powershell-script-line/25300>\
**Category:** PowerShell Help\
**Created:** [January 13, 2025, 5:25am UTC](https://forums.powershell.org/t/decipher-powershell-script-line/25300 "2025-01-13T05:25:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marinewonder](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@marinewonder](https://forums.powershell.org/u/marinewonder)\
**Post date:** [January 13, 2025, 5:25am UTC](https://forums.powershell.org/t/decipher-powershell-script-line/25300/1 "2025-01-13T05:25:38Z")

</div>

Hello,

I’m occassionally working with Powershell but am far from experienced.

Can someone decipher this combined powershell line?

powershell -command “& {compress-archive ‘localuse.xml’ -destinationPath ‘%AppData%\Test\temp.zip’}”

The command is scripted within a CMD script. But it also fails when I run it directly in powershell.

It fails with the error that “compress-archive” is not a recognized as the name of a cmdlet, function, script file or operable program.

---

<div class="post-metadata">

**Author:** ![grey0ut](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/grey0ut/32/5310_2.png) [@grey0ut](https://forums.powershell.org/u/grey0ut)\
**Post date:** [January 13, 2025, 7:26am UTC](https://forums.powershell.org/t/decipher-powershell-script-line/25300/2 "2025-01-13T07:26:02Z")

</div>

responding from mobile:  
It calls the PowerShell executable with the “command” argument specifying what commands(s) to run within the Powershell session.  
The ampersand is the [call operator](https://ss64.com/ps/call.html) and basically says to run everything within the curly braces.  
[Compress-archive](https://ss64.com/ps/compress-archive.html) is used for creating a zip archive. Based on the error message you’ve received my guess is that you don’t have Windows PowerShell v5.1 or newer which means you’re probably on something older than Windows 10.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [February 12, 2025, 7:26am UTC](https://forums.powershell.org/t/decipher-powershell-script-line/25300/3 "2025-02-12T07:26:27Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
