반응형
[시스템] 유형을 찾을 수 없습니다.PowerShell의 Web.HttpUtility]
PowerShell을 사용하여 Microsoft Translator 응용 프로그램에 대한 액세스 토큰을 가져오려고 하지만 다음 오류로 인해 프로세스의 특정 명령이 실패합니다.
Unable to find type [System.Web.HttpUtility]
이 오류를 수신하기 전에 MSDN 페이지의 코드를 복사하여 PowerShell ISE에 붙여넣고 자리 표시자 값을 실제 자격 증명으로 교체했습니다.
# ...
$ClientID = '<Your Value Here From Registered Application>'
$client_Secret = ‘<Your Registered Application client_secret>'
# If ClientId or Client_Secret has special characters, UrlEncode before sending request
$clientIDEncoded = [System.Web.HttpUtility]::UrlEncode($ClientID)
$client_SecretEncoded = [System.Web.HttpUtility]::UrlEncode($client_Secret)
# ...
이것이 작동하려면 어떤 코드를 추가해야 합니까?
로드해야 합니다.System.Web집회의사용Add-Type그런 cmdlet,
PS C:\> [System.Web.HttpUtility]::UrlEncode("www.google.com")
Unable to find type [System.Web.HttpUtility].
PS C:\> Add-Type -AssemblyName System.Web
PS C:\> [System.Web.HttpUtility]::UrlEncode("www.google.com")
www.google.com
언급URL : https://stackoverflow.com/questions/38408729/unable-to-find-type-system-web-httputility-in-powershell
반응형
'programing' 카테고리의 다른 글
| .NET에서 struct와 class의 차이점은 무엇입니까? (0) | 2023.05.29 |
|---|---|
| Github repo in Yarn 패키지 설치 방법 (0) | 2023.05.29 |
| 피쳐 분기의 단일 파일을 마스터와 동일하게 재설정합니다. (0) | 2023.05.24 |
| tar: .svn 등을 포함하여 현재 디렉터리에 있는 모든 파일 및 디렉터리를 추가 (0) | 2023.05.24 |
| 1.8.3에서 Gitstash pop 특정 스택을 어떻게 저장합니까? (0) | 2023.05.24 |