To set the ExecutionPolicy using Powershell, run Powershell as Administrator.
Type in Set-ExecutionPolicy followed by the ExecutionPolicy you wish to use.
Microsoft has disabled scripting by default to prevent malicious code from being executed.
To set the ExecutionPolicy using Powershell, run Powershell as Administrator.
Type in Set-ExecutionPolicy followed by the ExecutionPolicy you wish to use.
Microsoft has disabled scripting by default to prevent malicious code from being executed.
To delete a file or Folder in Powershell you can use the following snippet.
remove-item -path "C:\Users\Codesnippets\Desktop\Test.xml" -force -recurse
remove-item -path "C:\Users\Codesnippets\Desktop\Folder1" -force -recurse
for more informations see Using the Remove-Item Cmdlet
To start a application and wait for exit in Powershell you can use the following snippet.
start-process -filepath "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" -Wait -NoNewWindow -argumentlist '-args'
for more informations take a look at the MSDN Start-Process
To check if file or folder exists in Powershell you can use the following snippet.
if(test-path "C:\Users\Codesnippets\Desktop\Test.xml") { echo "exists!" } else { echo "not exists!" }
if(test-path "C:\Users\Codesnippets\Desktop") { echo "exists!" } else { echo "not exists!" }