ISVStar 最近的时间轴更新
ISVStar

ISVStar

V2EX 第 404475 号会员,加入于 2019-04-23 05:53:45 +08:00
今日活跃度排名 501
寻找外贸 B2B 官网开发外包 (WordPress, WooCommerce)
酷工作  •  ISVStar  •  30 天前  •  最后回复来自 Kimm
4
ChatGPT 终于还是被玩坏了
  •  3   
    OpenAI  •  ISVStar  •  181 天前  •  最后回复来自 tongz
    66
    Windows Server 2022 文件共享会损坏文件?
    Windows  •  ISVStar  •  2022-02-23 22:48:22 PM  •  最后回复来自 Osk
    8
    iOS 14.3 快捷指令 换壁纸 其实可以做到更多
    分享发现  •  ISVStar  •  2021-01-08 19:06:10 PM  •  最后回复来自 ISVStar
    8
    讨论一下订阅制服务的乱象
    随想  •  ISVStar  •  2020-05-13 08:20:42 AM  •  最后回复来自 f2ck
    76
    ISVStar 最近回复了
    #capture the active scheme GUID

    $activeScheme = cmd /c "powercfg /getactivescheme"

    $regEx = '(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}'

    $asGuid = [regex]::Match($activeScheme,$regEx).Value



    #relative GUIDs for Lid Close settings

    $pwrGuid = '4f971e89-eebd-4455-a8de-9e59040e7347'

    $lidClosedGuid = '5ca83367-6e45-459f-a27b-476b1d01c936'



    # DC Value // On Battery // 0 = do nothing

    cmd /c "powercfg /setdcvalueindex $asGuid $pwrGuid $lidClosedGuid 0"

    # AC Value // While plugged in // 0 = do nothing

    cmd /c "powercfg /setacvalueindex $asGuid $pwrGuid $lidClosedGuid 0"



    #apply settings

    cmd /c "powercfg /s $asGuid"



    echo "You can now close the lid ..."

    $ScreenCount = (Get-CimInstance -Namespace root\wmi -ClassName wmiMonitorID | Measure-Object).Count

    Do

    {

    $ScreenCountRecur = (Get-CimInstance -Namespace root\wmi -ClassName wmiMonitorID | Measure-Object).Count

    Start-Sleep -Seconds 1

    }

    While($ScreenCountRecur -ge $ScreenCount)



    # DC Value // On Battery // 1 = sleep

    cmd /c "powercfg /setdcvalueindex $asGuid $pwrGuid $lidClosedGuid 1"

    # AC Value // While plugged in // 1 = sleep

    cmd /c "powercfg /setacvalueindex $asGuid $pwrGuid $lidClosedGuid 1"
    我写了一个这样的 PowerShell 脚本,不完全符合你的要求。运行脚本后,忽略下一次合盖睡眠。

    # grab powercfg guids necessary for lid switch action
    # https://docs.microsoft.com/en-us/windows-hardware/customize/power-settings/power-button-and-lid-settings-lid-switch-close-action

    #capture the active scheme GUID
    $activeScheme = cmd /c "powercfg /getactivescheme"
    $regEx = '(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}'
    $asGuid = [regex]::Match($activeScheme,$regEx).Value

    #relative GUIDs for Lid Close settings
    $pwrGuid = '4f971e89-eebd-4455-a8de-9e59040e7347'
    $lidClosedGuid = '5ca83367-6e45-459f-a27b-476b1d01c936'

    # DC Value // On Battery // 0 = do nothing
    cmd /c "powercfg /setdcvalueindex $asGuid $pwrGuid $lidClosedGuid 0"
    # AC Value // While plugged in // 0 = do nothing
    cmd /c "powercfg /setacvalueindex $asGuid $pwrGuid $lidClosedGuid 0"

    #apply settings
    cmd /c "powercfg /s $asGuid"

    echo "You can now close the lid ..."
    $ScreenCount = (Get-CimInstance -Namespace root\wmi -ClassName wmiMonitorID | Measure-Object).Count
    Do
    {
    $ScreenCountRecur = (Get-CimInstance -Namespace root\wmi -ClassName wmiMonitorID | Measure-Object).Count
    Start-Sleep -Seconds 1
    }
    While($ScreenCountRecur -ge $ScreenCount)

    # DC Value // On Battery // 1 = sleep
    cmd /c "powercfg /setdcvalueindex $asGuid $pwrGuid $lidClosedGuid 1"
    # AC Value // While plugged in // 1 = sleep
    cmd /c "powercfg /setacvalueindex $asGuid $pwrGuid $lidClosedGuid 1"
    @lsk569937453 能加一下 HAProxy 的测试测试吗?
    69 天前
    回复了 qiumaoyuan 创建的主题 SSD SSD 价格目前是低谷了么?
    @richardwong #45 我没用过,回答不了你的问题。你可以去什么值得买上看看别人分享的经验。
    69 天前
    回复了 qiumaoyuan 创建的主题 SSD SSD 价格目前是低谷了么?
    @richardwong #42 可以找转运,具体没用过。
    70 天前
    回复了 qiumaoyuan 创建的主题 SSD SSD 价格目前是低谷了么?
    @getadoggie #20 要用优惠码 SSD990LCS
    70 天前
    回复了 qiumaoyuan 创建的主题 SSD SSD 价格目前是低谷了么?
    美国官网现在,990 Pro 2TB 154 含税,刚买
    72 天前
    回复了 Livid 创建的主题 游戏 Resident Evil 4 Remake: Fatal D3D error (25)
    刚好看到
    关于   ·   帮助文档   ·   博客   ·   nftychat   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2447 人在线   最高记录 5634   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:54 · PVG 09:54 · LAX 18:54 · JFK 21:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.