powershell

need to change file created date based on csv

烂漫一生 提交于 2021-01-06 05:31:43
问题 Good evening everyone. I have been able to change date created attribute of a file using the following command $(Get-Item test1.html).CreationTime=$(Get-Date "11/24/2010 06:00 am") My problem is that I have 10000 files that need to have this done based on a csv file. CSV has two columns file name or and file created date. CSV and files are in same folder. How can I rename the files based on the corresponding date in column 2 eg. 1.pdf 2010/12/12 2.pdf 2011/13/01 3.pdf 1989/12/12 etc Thanks in

Windows 2012 R2安装.net3.5

主宰稳场 提交于 2021-01-05 18:07:43
服务器需安装SQL 2008 ,因需安装.net3.5,没有想到2012出于安全竟然不让手动安装,对于源文件也是把控比较严,折腾了好一会儿才解决问题 有参才一下powershell等安装命令,均失败。采用安装包也不让安装,后只能使用原盘里的源包进行安装。 服务器版本: Windows 2012 R2 X64 安装程序版本:.net3.5 一、打开服务器管理器,仪表板 单击添加角色与功能 二、 下一步,下一步,下一步,下一步,都是默认比较多 三,选择添加.net3.5功能 四、指定原安装盘上去,将系统光盘加载进去 五、这用的是D盘位置,源路径输入 D:\SOURCES\SXS\ 确定 安装成功 完成。 来源: oschina 链接: https://my.oschina.net/u/4263629/blog/3839786

Docker on Windows Server 2016 TP4 Downloading git in container through powershell

夙愿已清 提交于 2021-01-05 12:43:38
问题 I have an angular UI and a nodejs api. I am currently running windows server 2016 TP4 in Azure.Here are the steps I go through: I am able to remote in, create images, create containers based off those images, and attach to those containers no problem. I pulled a nodejs image from docker: docker pull microsoft/node and then created a container from that image: docker run --name 'my_api_name' -it microsoft/node cmd That command takes me into the container via a windows command prompt. I type

Powershell function call changing passed string into int

跟風遠走 提交于 2021-01-05 08:58:46
问题 So I am using the kind of buggy Sapien powershell studio to make a powershell driven GUI application, and I am attempting to perform an ADSI query. $nameOfDeviceInput is a System.Windows.Forms.TextBox On one form, I have the following function: $buttonPerformAction_Click={ if (FindInAD($nameOfDeviceInput.Text).Count -gt 0) { $buttonPerformAction.BackColor = 'Red' $buttonPerformAction.Text = "System already exists in AD with that name. Try another name" return } ..... } On the "main" form, I

PowerShell - Find and replace multiple patterns on the same line and store the correspondences in separate file

ε祈祈猫儿з 提交于 2021-01-05 07:32:46
问题 I have a very large file with thousands of lines, some of the lines are very, very long with various of data. I need to find and replace multiple strings inside that file and several of the strings to be replaced can be on the same line. At the same time the replaced value should increment at each occurrence. In a separate file $tmp I need to keep only the "unique" pairs of "original" value and the corresponding "replaced" value in case of need to revert back the original values. With the

Powershell: specify email:password with random data in between

与世无争的帅哥 提交于 2021-01-05 07:25:46
问题 Similar like this - Extract email:password However we have here the situation that in some files there is other data between the data I want to parse, as example: email:lastname:firstname:password or email:lastname:firstname:dob:password So my question is - with which command would I be able to ignore 2 segments like "lastname:firstname" or even 3 parts "lastname:firstname:dob". I am using the below regex to retrieve email:password from a big list. $sw = [System.IO.StreamWriter]::new("$PWD

Powershell: specify email:password with random data in between

半世苍凉 提交于 2021-01-05 07:25:29
问题 Similar like this - Extract email:password However we have here the situation that in some files there is other data between the data I want to parse, as example: email:lastname:firstname:password or email:lastname:firstname:dob:password So my question is - with which command would I be able to ignore 2 segments like "lastname:firstname" or even 3 parts "lastname:firstname:dob". I am using the below regex to retrieve email:password from a big list. $sw = [System.IO.StreamWriter]::new("$PWD

Subexpression printing out same strings? Powershell

最后都变了- 提交于 2021-01-05 06:13:20
问题 I have this code which deletes User Profiles off a remote machine. The removal of profiles work just fine but, the Aesthetic of doing so doesn't. What do i mean? I'm passing the user display names to an index and making a selection out of it, and that works fine in regards to assigning the proper names to the appropriate Index Number its associated to in C:\users. The next line of code is it grabbing the selections i made, and running through them displaying the same name i did for the index,

Subexpression printing out same strings? Powershell

泪湿孤枕 提交于 2021-01-05 06:12:05
问题 I have this code which deletes User Profiles off a remote machine. The removal of profiles work just fine but, the Aesthetic of doing so doesn't. What do i mean? I'm passing the user display names to an index and making a selection out of it, and that works fine in regards to assigning the proper names to the appropriate Index Number its associated to in C:\users. The next line of code is it grabbing the selections i made, and running through them displaying the same name i did for the index,

新型 Golang 蠕虫在服务器上投放 XMRig Miner 病毒

╄→尐↘猪︶ㄣ 提交于 2021-01-04 22:22:40
译者:知道创宇404实验室翻译组 原文链接: https://www.intezer.com/blog/research/new-golang-worm-drops-xmrig-miner-on-servers/ 介绍 12月初,我们发现了一种新的用Golang编写的蠕虫。该蠕虫延续了 Golang在2020年流行的多平台恶意软件趋势。 该蠕虫试图在网络中传播,以便大规模运行XMRig Miner。恶意软件同时针对Windows和Linux服务器,可以轻松地从一个平台转移到另一个平台。它的目标是面向公众的服务:密码较弱的MySQL、Tomcat管理面板和Jenkins。在较旧的版本中,该蠕虫还尝试利用WebLogic的最新漏洞:CVE-2020-14882。 在我们的分析过程中,攻击者不断更新C&C服务器上的蠕虫。这表明该蠕虫处于活跃状态,并且可能在将来的更新中针对其他弱配置的服务。 技术分析 该攻击使用三个文件:一个dropper脚本(bash或powershell)、一个Golang二进制蠕虫和一个XMRig Miner,所有这些文件都托管在同一C&C上。 目前,还未检测到ELF蠕虫二进制文件和bash dropper脚本。 图1显示了VirusTotal中的ELF蠕虫二进制检测结果。 图1:在VirusTotal