![](/img/trans.png)
[英]Attempting to convert value into integer
我是 Powershell 的新手(過去幾天我只是在 ISE 中稍微瀏覽了一下)。 我正在開發一個從 Windows 系統中提取電池容量值的程序,但我卡在了我的代碼中。 我想對調用“剩余容量”和“設計容量”時返回的數值進行算術運算(具體是用較小的值除以較大的值)。 預先感謝您花時間和精力解決我的問 ...
[英]Attempting to convert value into integer
我是 Powershell 的新手(過去幾天我只是在 ISE 中稍微瀏覽了一下)。 我正在開發一個從 Windows 系統中提取電池容量值的程序,但我卡在了我的代碼中。 我想對調用“剩余容量”和“設計容量”時返回的數值進行算術運算(具體是用較小的值除以較大的值)。 預先感謝您花時間和精力解決我的問 ...
[英]Trying to get FullChargeCapacity from Win32_PortableBattery Class
我正在嘗試獲取我們公司遠程筆記本電池信息的完全充電容量,但是當我運行代碼時它返回空 output。 我做了一些谷歌搜索,我知道我需要向電池驅動程序詢問信息(我想也可以在注冊表中找到),但我的編程技能很弱,不知道該怎么做。 我也在代碼末尾做DesignCapacity而不是FullChargeCap ...
[英]Get-WmiObject delay outcome when check C disk storage
檢查 C 磁盤存儲時獲取 WmiObject 延遲結果。 當我輸入我的計算機名稱並輸入'1'來檢查C磁盤存儲時,第一次不會返回結果,我需要再次輸入'1'它會返回第一個和第二個結果。 但是,如果我單獨測試 function 或 Get-WMIObject 行,它會完美運行。 任何人都知道這里發生了什么 ...
[英]where can i find the Get-WmiObject file location in powershell?
我想更改 Get-wmiObject 文件本身中的一些代碼來為我做一些功能並替換一些其他的。 最重要的是由於某種原因更改了一些命令 output 。 我該怎么做或者有可能嗎? ...
[英]PowerShell command to get installed application/software version
我需要從控制面板讀取產品版本以了解特定應用。 直到現在我都在使用這個命令。 將我的系統升級到 Windows 11 后,它拋出了這個異常 - 誰能建議我應該使用哪個命令來讀取 Windows 11 系統上的應用程序版本。 提前致謝! ...
[英]NodeJS get CPU temperature - Use OpenHardwareMonitorLib.dll in NodeJS
我正在嘗試獲取通過 ssh 連接的計算機的 CPU 和 GPU 溫度。 當我嘗試wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature命令時,出現此錯誤; 然后我決定使用https:/ ...
[英]Exception calling "GetOwner"
團隊! 最近,我的遠程 pssession 腳本在獲取進程所有者時失敗。 遠程用戶具有管理權限。 我們有錯誤: 調用“GetOwner”的異常:“由於對象的當前狀態,操作無效。” 如果我們在本地會話下運行它,則不會發生錯誤。 有什么建議么? ...
[英]How to get output of PowerShell's Get-WmiObject in C#
我需要獲取哪個網絡接口連接到哪個網絡。 我發現可以在 MSFT_NetConnectionProfile 中訪問此信息。 不幸的是,我無法直接從 C# 訪問它(我得到ManagementException: Provider load failure on computer where it sho ...
[英]I'm having issues with removing profiles in PowerShell
我已經開發了幾個腳本來從機器中刪除未使用的配置文件,除了一些重要的帳戶。 在使用Remove-WmiObject 、 Remove-CimInstance和.Delete()時,我使用的每個腳本總是給我同樣的錯誤。 我確信所有這些腳本都應該工作,但我收到了同樣的錯誤。 請參閱以下腳本和附加錯誤。 我 ...
[英]Error calling get-wmiobject for Win32_powerplan
我正在嘗試使用以下代碼在 Windows 11 上的 PowerShell 7 中返回Win32_PowerPlan : 但是,我得到了 output:get-wmiobject : At line:1 char:1 + get-wmiobject -namespace "root\cimv2\p ...
[英]Powershell: How to export AD PC results to CSV
新手問題在這里。 我在下面為 powershell 提供了這個腳本,它為我提供了來自 AD 的 PC 信息。 但我一直無法將結果導出到 csv。 還如何獲得 ipv4 ip 地址而不包括 ipv6? 並說如果 PC 處於離線狀態,是否可以再給我一列以顯示如果它處於離線狀態,它會返回 RPC 服務器 ...
[英]How to get the type of an network adapter (Wi-Fi, Ethernet, Bluetooth) in Windows Powershell?
如何在 Windows Powershell 中獲取網絡適配器(Wi-Fi、以太網、藍牙)的類型? 目前我正在使用: get-wmiobject win32_networkadapter -filter "PhysicalAdapter = true" | select * get-wmiobje ...
[英]How to change an output formed by hashstables Powershell
我將以下查詢值存儲在變量中: 當我打印該變量時,問題就開始了,因為該變量從查詢中獲取了一個 object,它由像這個 output 中的哈希表形成: 我怎么能像這樣得到 output : ...
[英]i trying to collect different info with Get-ADComputer, Get-WmiObject and Get-windowsfeature
我正在嘗試從我的 AD 中列出的所有計算機中收集不同的屬性,但我無法獲取重新收集的查詢的格式 我運行 get-adcomputer 查詢 我從 $computerlist 中列出的所有計算機收集信息 最后,我嘗試列出在唯一表格中收集的所有信息 但列出的表格僅在一行中 該表僅在一行中列 ...
[英]Concatenate string to integer inside of Get-WmiObject table - PowerShell
我想將“GB”添加到“Size”的每個實例中,以便每個輸出顯示“8GB”。 我不確定如何將字符串添加或連接到表中的整數... 我曾嘗試簡單地添加+"GB" ,將 "GB" 分配給一個變量,然后添加+ $GB 。 但是返回Select-Object : A positional parameter ...
[英]Remote WMI query failing with 'A security package specific error occurred' when using Azure Active Directory user
我正在嘗試使用 PowerShell cmdlet 查詢遠程計算機: Get-WmiObject並使用 Azure AD 中具有Azure AD joined device local administrator角色和遠程計算機上Virtual Machine Administrator Login ...
[英]Filtering Names: Get-WmiObject Win32_NetworkAdapter
作為我的清單腳本的一部分,我想添加 DHCP 啟用的查詢我是否需要以以下方式對網卡進行采樣:“以太網”、“網卡”、“本地” 我如何在這里添加它:? ...
[英]Check if Windows is activeted via wmi filter
如果 Windows 未激活,我想收到一條消息我創建了在登錄時運行消息的 gpo 如果我通過 wmi filter Get-wmiobject -query 'select licensestatus from softwarelicensingproduct where LicenseStatus ...
[英]Get-WmiObject -Filter OR not working with NULL
這些 cmdlet 有效: 我似乎無法將它們與 OR 語句結合起來,我不知道為什么: Get-WmiObject Win32_PNPSignedDriver -Filter "DriverProviderName <> 'Microsoft' OR DriverProviderName ...
[英]During uninstall third party application from control panel, I am getting this error. You cannot call a method on a null-valued expression PowerShell
我有腳本通過 PowerShell 從控制面板卸載Veeam軟件。 在卸載最后一個 Veeam 組件期間,我收到以下錯誤: 我不知道,專家幫我解決它。 我在等你的回復。 我在下面附上了我的腳本。 ...