Questions tagged as 'powershell'

1
answer

Compare dates with powershell

Good afternoon; I have a problem when comparing dates with powershell, the dates with which I make the comparison are in a CSV file, example: titulo - recordatorio - vence Noticia01 - 13/01/2018 - 30/01/2018 Noticia02 - 14/01/2018 -...
asked by 12.01.2018 / 18:53
1
answer

Powershell continues with the deletion even if the variable is incorrect

Good morning, everyone. I have a bug in my Powershell script where I am deleting the contents of a directory. The path of said directory is stored in a variable and is used in the following way: Write-Host "* Vaciando '$RutaTempFicheros'" -...
asked by 10.01.2018 / 12:03
1
answer

import BD in powershell

Currently I need to import the database individually with this part of the script > Import-Module $PSScriptRoot\..\util\utilConnection.ps1; Import-Module > $PSScriptRoot\..\util\utilDate.ps1; > #Import-Module $PSScriptRoot\..\logging\...
asked by 08.01.2018 / 16:47
1
answer

Run command in two powershell

Good morning: I want to execute a powershell code in "Microsoft DOS" and the result of this is to put it in a variable and then use it in another command, which I could only run in DOS, maybe it could be executed by powershell ... Specific...
asked by 12.12.2017 / 13:45
0
answers

Script to upload the Windows event log to a SQL DB

Good morning, Clarify first that the script works, but surely among all of you help me to optimize it. This is a script that extracts security events (Logon / Logoff from the machine) and stores them in a SQL database. Here goes: ' Set t...
asked by 17.11.2017 / 15:51
1
answer

Upload files to an FTP with PowerShell

Good morning, I'm trying to upload files to an FTP with PowerShell but it gives me an error, if you can bring some light I would appreciate it very much. $ftp = "ftp://192.168.0.2/" $user = "user" $pass = "pass" $webclient = New-Object...
asked by 20.10.2017 / 09:52
0
answers

Python error "TypeError: must be type, not classobj"

I have the following code ( that I got from this article ), that what it does is open a external application such as a web page or a file by means of a powershell. import getopt import os import shutil import sys import tempfile from zipfile...
asked by 14.09.2017 / 13:13
1
answer

Move files older than a month PowerShell

Good morning, I have a question with a PowerShell script. It runs every 1 of every month, and you have to move to another route, all the files that were created before a month. That is, if you run on August 1 you have to move all files created u...
asked by 08.08.2017 / 10:14
1
answer

Open a file in use by another program

I am trying to access, by means of a powershell code inserted in a bat, to a log file created by another program but it gives me the following error: Exception when calling "OpenRead" with arguments "1": "The process can not get access to th...
asked by 29.06.2017 / 21:22
0
answers

Enter a reading counter to variable

Hello that such a good afternoon, what I want to do is to count x times a word defined in a text and after that put it in a variable which will be printed in a pop-up box. The little code I have is this: @echo off :bucle find /c "Perl" < te...
asked by 06.07.2016 / 23:44