title: %~dp0 equivalent in powershell (using Expand-Archive cmdlet)
body: <p>I'm pretty new to scripting (especially powershell) and new to Stack Overflow, so please, excuse my ignorance and please bear with me! I will do my best to specifically explain what I'm looking to do and hopefully someone can give a detailed response of what I could do to make it work..</p>
  <p><strong>Intended Process/Work Flow:</strong> A co-worker downloads &quot;Install.zip&quot; file that has all the necessary files. This &quot;Install.zip&quot; file contains &quot;Setup.bat&quot; file (for computer config), &quot;Fubar.zip&quot; file, 2 powershell scripts, and a custom powerplan (.pow) file. Once downloaded they will run the &quot;Setup.bat&quot; file and it will pretty much do all the work. Inside that batch file it calls 2 powershell scripts. 1)&quot;Download.ps1&quot; - Downloads some other files from the web. 2.) &quot;Unzip.ps1&quot; - Unzips &quot;Fubar.zip&quot; and places contents in another folder - C:\TEST\</p>
  <p><strong>Issue:</strong> I've recently gotten familiar with using %~dp0 in batch files. I want to make sure that the location where my co-worker initially downloads the Install.zip doesn't throw off my batch file. So for example.. some people will download .zip files to the &quot;Downloads&quot; folder, then extract contents to proper destination. Others will download the .zip to a specific folder, then extract it within that folder. [Ex: C:\Alex\Install.zip --Extraction-- C:\Alex\Install\((Content))] So I tried to not pre-define file locations due to the variables. I've gotten the %~dp0 to work everywhere I need it to in my batch file. The only issue I have is getting my powershell scripts to use same working directory that my batch file is in. *My batch file and my powershell scripts will always be in the same directory. (Wherever that may be)</p>
  <p><strong>Goal:</strong> I want my powershell script (&quot;Unzip.ps1&quot;) to look for my &quot;Fubar.zip&quot; file in the same directory that its currently running in. (Again - Wherever that may be) I basically want to remove any variables that may throw off the powershell script. I want it to always use it's current working directory to locate Fubar.zip. I basically need powershell to either use its current working directory OR figure out a way to have it pull its current working directory and use that to look for &quot;Fubar.zip&quot;.</p>
  <p>my current &quot;Unzip.ps1&quot; powershell script is extremely basic.</p>
  <p><strong>Unzip.ps1</strong>:Expand-Archive -Force c:\ALEX\Install.zip\Fubar.zip -dest c:\TEST\</p>
  <p><strong>Batch File Command that calls the Unzip.ps1 script:</strong> Powershell.exe -executionpolicy remotesigned -File  %~dp0UNZIP.ps1</p>
  <p>Please keep in mind, I'm just learning scripting and I'm teaching myself. My knowledge is limited, but I've made it this far and this is the only part I'm stuck on. Please give clear responses. Any help or advice would be extremely appreciated! <strong>Using PowerShell 5.0</strong></p>
  <p>Thanks in advance!</p>