powershell

Visual Studio Code fails to open from Powershell

こ雲淡風輕ζ 提交于 2021-02-19 06:13:55
问题 I'm trying to open Visual Studio Code from Powershell using the code command while inside a folder. When I try to do this, I always get this error: Blockquote code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + code . + ~~~~ + CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException +

Visual Studio Code fails to open from Powershell

与世无争的帅哥 提交于 2021-02-19 06:12:48
问题 I'm trying to open Visual Studio Code from Powershell using the code command while inside a folder. When I try to do this, I always get this error: Blockquote code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + code . + ~~~~ + CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException +

Powershell Invoke-WebRequest and character encoding

半世苍凉 提交于 2021-02-19 06:10:18
问题 I am trying to get information from the Spotify database through their Web API. However, I'm facing issues with accented vowels (ä,ö,ü etc.) Lets take Tiësto as an example. Spotify's API Browser can display the information correctly: https://developer.spotify.com/web-api/console/get-artist/?id=2o5jDhtHVPhrJdv3cEQ99Z If I make a API call with Invoke-Webrequest I get Ti??sto as name: function Get-Artist { param($ArtistID = '2o5jDhtHVPhrJdv3cEQ99Z', $AccessToken = 'MyAccessToken') $URI = "https:

How to change PowerShell default module installation folder?

耗尽温柔 提交于 2021-02-19 06:01:27
问题 Is there a way to change PowerShell module installation folder (the folder that modules are placed after Install-Module)? This is why I want to do this: I'm on Windows 10, PowerShell 5.1.17763.503 My default installation folder is Documents\WindowsPowerShell\Modules My Documents folder have been moved to a location containing , symbol (corporate policies) PS has a bug loading .ps1 that contain classes and have , in the file path (similar to this issue.) What I've tried: I thought the

How to get out of PowerShell's encoding hell?

China☆狼群 提交于 2021-02-19 05:44:05
问题 > cat .\foo.txt abc > cat .\foo.txt | md5sum c13b6afecf97ea6b38d21a8f5167fa1e *- > md5sum foo.txt b79545611b3be30f90a0d21ef69bca82 *foo.txt cat and md5sum are the unix port (from the Windows Git distribution). This is a toy example for my real use case which is piping of a binary data to a legacy python script that I can't change. Because of the pipe doing encoding, the binary file becomes corrupted. I tried changing $OutputEncoding , [Console]::OutputEncoding and using chcp , all didn't help

Powershell ConvertTo-SecureString ObjectNotFound

岁酱吖の 提交于 2021-02-19 05:42:26
问题 After upgrading to powershell 3.0 existing scripts stopped working with an error ConvertTo-SecureString : The term 'ConvertTo-SecureString' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + ConvertTo-SecureString + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (ConvertTo-SecureString:String) [], CommandNotFoundException +

how to copy updated files to new folder and create directory as source if not exist?

柔情痞子 提交于 2021-02-19 04:37:06
问题 I was trying to compare files in 2 folders and copy those new and updated files to a diff folder, for example: newFolder has a\aa.txt (new folder and new file) b\aa.txt b\ab.exe (modified) b\ac.config (new file) aa.txt (modified) ab.exe (new file) ac.config oldFolder has b\aa.txt b\ab.exe aa.txt ac.config In this case, what I expect in diff folder should be: diffFolder a\aa.txt b\ab.exe b\ac.config aa.txt ab.exe So far I have been searching on google and trying different approaches, but still

cmd.exe throws error “& was unexpected at this time.”

痞子三分冷 提交于 2021-02-19 04:18:30
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was

cmd.exe throws error “& was unexpected at this time.”

萝らか妹 提交于 2021-02-19 04:15:02
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was

cmd.exe throws error “& was unexpected at this time.”

六眼飞鱼酱① 提交于 2021-02-19 04:13:06
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was