Giter VIP home page Giter VIP logo

powershell-no-library-just-functions's People

Contributors

astralissomnium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

powershell-no-library-just-functions's Issues

Add documentation

A README.md file with informations and examples with description on the differences between the functions would be appreciated.

Not an issue - Can we add validation

This is not an issue but a request, first thanks for the amazing script. It's the only one that can really go through subdirectories and get files.

I was wondering if we can add validation to check if the file exists on the remote FTP server to skip it and carry on. I noticed if the script has been terminated and I retry to run it, it starts over and overwrite the existing data so it consume so much time if the script was terminated. Thanks again and hopefully you read my message.

Get-FtpChildItem not working

I'm trying to use the get-ftpchilditem from the ftpmodule but is not working.

Below the commented lines in the file to use as an example.
Both of them seem to have the option -ftpfilepath wrong since the function is expecting $ftpfolderpath.

#Get-FtpChildItem -ftpFilePath "ftp://myHost.com/root/leaf/" -userName "User" -password "pw" -hidden $false -File
#Get-FtpChildItem -ftpFilePath "ftp://myHost.com/root/leaf/" -userName "User" -password "pw" -Directory
function Get-FtpChildItem($ftpFolderPath, $username, $password, [System.Management.Automation.SwitchParameter]$file, [System.Management.Automation.SwitchParameter]$directory, $hidden = $true) {

If I run
Get-FtpChildItem -ftpFilePath "ftp://192.168.1.1/DIR/" -userName "User" -password "pw" -hidden $false -File
I get the follwoing error

Exception calling "Create" with "1" argument(s): "Value cannot be null.
Parameter name: requestUri"
At C:\scripts\modules\FTPModule.ps1:2 char:5

  • $ftprequest = [System.Net.FtpWebRequest]::Create($sourceuri)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentNullException

The property 'Method' cannot be found on this object. Verify that the property exists and can be set.
At C:\scripts\modules\FTPModule.ps1:3 char:5

  • $ftprequest.Method = $method
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

The property 'Credentials' cannot be found on this object. Verify that the property exists and can be set.
At C:\scripts\modules\FTPModule.ps1:4 char:5

  • $ftprequest.Credentials = New-Object System.Net.NetworkCredential ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\scripts\modules\FTPModule.ps1:79 char:5

  • $FTPResponse = $ftprequest.GetResponse()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\scripts\modules\FTPModule.ps1:80 char:5

  • $ResponseStream = $FTPResponse.GetResponseStream()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

New-Object : A constructor was not found. Cannot find an appropriate constructor for type System.IO.Streamreader.
At C:\scripts\modules\FTPModule.ps1:81 char:21

  • $StreamReader = New-Object System.IO.Streamreader $ResponseStream
    
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (:) [New-Object], PSArgumentException
    • FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At C:\scripts\modules\FTPModule.ps1:82 char:5

  • $DirListing = (($StreamReader.ReadToEnd()) -split [Environment]:: ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\scripts\modules\FTPModule.ps1:83 char:5

  • $StreamReader.Close()
    
  • ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\scripts\modules\FTPModule.ps1:84 char:5

  • $FTPResponse.Close()
    
  • ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Get-FtpChildItemHidden Example not correct

Your Example isn´t correct:

#Get-FtpChildItemHidden -ftpFilePath "ftp://myHost.com/root/leaf/" -userName "User" -password "pw" -File -Directory

should be:

#Get-FtpChildItemHidden -ftpFolderPath "ftp://myHost.com/root/leaf/" -userName "User" -password "pw" -File -Directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.