質問するログイン新規登録

回答編集履歴

1

ミス

2020/06/17 01:25

投稿

tosi
tosi

スコア553

answer CHANGED
@@ -1,23 +1,1 @@
1
- Get-NetConnectionProfileは32bitのPowerShellは動きせん
2
- [https://stackoverflow.com/questions/28156066/how-to-resolve-get-netconnectionprofile-provider-load-failure-on-x86-powershel](https://stackoverflow.com/questions/28156066/how-to-resolve-get-netconnectionprofile-provider-load-failure-on-x86-powershel)
3
-
4
- 下記のコードでGet-NetConnectionProfileコマンドが正常に動くか試して見て下さい。
5
- ```VBA
6
- Sub Test_Sample_Miniature()
7
-
8
- Dim WSH As Object
9
- Dim cmdstr As String
10
- Dim Result
11
-
12
- Set WSH = CreateObject("WScript.Shell")
13
- cmdstr = Chr(34) & "& {Get-NetConnectionProfile}" & Chr(34)
14
- Result = WSH.Run("PowerShell -NoExit -nologo -ExecutionPolicy Bypass -Command " & cmdstr, 4, True)
15
-
16
- Set WSH = Nothing
17
-
18
- End Sub
19
- ```
20
- Get-NetConnectionProfileをPowerShell32/64で動かした画像を添付いたします。
21
- ![イメージ説明](96b09f1642854654156c441e6c8cdd78.png)
22
- ![イメージ説明](8448fcd3745a3110afbc6db5b61a9f7d.png)
23
- 同様なエラーが出る様でしたら64bit版のVBAを利用すれば動くと思われます。
1
+ 記入ミスす。削除し