powershell

基于函数计算快速实现《为你写诗》(阿里云ECS)

一笑奈何 提交于 2020-12-08 11:45:22
简介 通过简单的几行指令,部署一个自己的表白神器,用技术为心爱的人写诗,将诗句,整理成图片,发送给心爱的Ta。 阿里云体验实验室地址(尚未购买ECS可在此处体验) https://developer.aliyun.com/adc/scenario/c6415182ebba4c9f990c2298e9a73eba 步骤一:连接ECS服务器 1.打开系统自带的终端工具。 Windows:CMD或Powershell。 MAC:Terminal。 2.在终端中输入连接命令ssh [username]@[ipaddress]。您需要将其中的username和ipaddress替换为第1小节中创建的ECS服务器的登录名和公网地址。例如: ssh root@123.123.123.123 命令显示结果如下: 输入yes。 同意继续后将会提示输入登录密码。 密码为已创建的云服务的ECS的登录密码。 登录成功后会显示如下信息。 步骤二:下载命令行工具 1.按照以下操作安装Node.js环境。 a. 下载Node.js安装包。 wget https://npm.taobao.org/mirrors/node/v12.4.0/node-v12.4.0-linux-x64.tar.xz b. 解压安装包并重命名。 tar -xvf node-v12.4.0-linux-x64.tar.xz && mv

“net use” in PowerShell without specifying drive

北城以北 提交于 2020-12-08 07:57:44
问题 With "net use", you could do the following: net use \\server /user:domian\username It would then prompt for a password, and any further CIFS connections made to that server using any program (cmd, Explorer, Word, etc) would automatically use that credential. Is there an equivalent way of doing this in PowerShell? I know New-PsDrive usually provides the answer for "net use", but it requires a drive letter to map: PS C:\WINDOWS\system32> New-PsDrive -PSProvider FileSystem -Root \\server

How can I prevent powershell from treating YabaDabaDoo as an alias for Get-YabaDabaDoo?

╄→尐↘猪︶ㄣ 提交于 2020-12-08 05:05:30
问题 Please, observe: C:\> Get-Date Tuesday, February 4, 2020 5:50:55 PM C:\> Date Tuesday, February 4, 2020 5:50:57 PM C:\> Get-Content C:\Users\mkharitonov\.bashrc alias ls='ls --color=auto -alhX' alias npp="C:/Program\ Files\ \(x86\)/Notepad++/notepad++.exe" C:\> Content C:\Users\mkharitonov\.bashrc alias ls='ls --color=auto -alhX' alias npp="C:/Program\ Files\ \(x86\)/Notepad++/notepad++.exe" C:\> I do not want this behavior. How can one control it? 回答1: As of PowerShell Core 7.0.0-rc.2, you

Powershell command to fetch all file path for all desired files extensions

空扰寡人 提交于 2020-12-07 07:12:15
问题 I want to search all drives using PowerShell on windows machine to get the list of all files along with their extensions - Based on desired extension we pass in it like - *.mp3 or Fetch all files with multiple extensions like - *.txt, *.mp3 etc. I tried below script but its giving only information from where we are running it. But I want to scan whole machine. Get-ChildItem -Path .\ -Filter ***.doc** -Recurse -File| Sort-Object Length -Descending | ForEach-Object { $_.BaseName } 回答1: This is

Powershell command to fetch all file path for all desired files extensions

偶尔善良 提交于 2020-12-07 07:05:29
问题 I want to search all drives using PowerShell on windows machine to get the list of all files along with their extensions - Based on desired extension we pass in it like - *.mp3 or Fetch all files with multiple extensions like - *.txt, *.mp3 etc. I tried below script but its giving only information from where we are running it. But I want to scan whole machine. Get-ChildItem -Path .\ -Filter ***.doc** -Recurse -File| Sort-Object Length -Descending | ForEach-Object { $_.BaseName } 回答1: This is

Powershell script to activate HDR in Windows 10

懵懂的女人 提交于 2020-12-07 05:04:59
问题 I've scoured the net for resources on this, to no avail. I cannot find the syntax to toggle HDR in Windows 10. As it currently stands, the GUI function for this is buried in a menu, and is a huge pain in the ass to turn on and off per application as needed. Ideally I'd like to see if there's an ability to specify per monitor, but given how wonky this implementation seems to be on Microsoft's part, just being able to activate it on my primary display would be enough. Thank in advance for your

Powershell script to activate HDR in Windows 10

你离开我真会死。 提交于 2020-12-07 05:03:01
问题 I've scoured the net for resources on this, to no avail. I cannot find the syntax to toggle HDR in Windows 10. As it currently stands, the GUI function for this is buried in a menu, and is a huge pain in the ass to turn on and off per application as needed. Ideally I'd like to see if there's an ability to specify per monitor, but given how wonky this implementation seems to be on Microsoft's part, just being able to activate it on my primary display would be enough. Thank in advance for your

Use Powershell to import website with Chinese domain

穿精又带淫゛_ 提交于 2020-12-06 17:05:18
问题 I’m trying use PowerShell to add website from xml file. When I just use CMD command appcmd add site /in < test.xml The binding of website is 「測試.com.tw」and everything be fine. But when I use Powershell Get-Content test.xml | appcmd add site /in The binding will be 「???.com.tw」 Even if I change chcp to 65001 or use “-encoding utf8” when get-content, but nothing change and still can’t correct import a website with Chinese domain. My server is 2008 R2 and Powershell 1.0 Does anyone know how I

Use Powershell to import website with Chinese domain

狂风中的少年 提交于 2020-12-06 17:03:36
问题 I’m trying use PowerShell to add website from xml file. When I just use CMD command appcmd add site /in < test.xml The binding of website is 「測試.com.tw」and everything be fine. But when I use Powershell Get-Content test.xml | appcmd add site /in The binding will be 「???.com.tw」 Even if I change chcp to 65001 or use “-encoding utf8” when get-content, but nothing change and still can’t correct import a website with Chinese domain. My server is 2008 R2 and Powershell 1.0 Does anyone know how I

Date conversion going wrong with different computer language

你说的曾经没有我的故事 提交于 2020-12-06 15:50:36
问题 I wrote a Powershell script for billing of customers. I get the list of bills, detect the month and get that specific bill. The timestamps are in Unix format and somehow I mess something up in the conversion depending on system language. For example: $FirstDayPrevMonth = (get-date -Day 1 -Hour 0 -Minute 0 -second 0 -Millisecond 0).Addmonths(-1) The conversion fails for systems that return: zondag 1 november 2020 00:00:00. The conversion succeeds for systems that return: Sunday, November 1,