Sending powershell output to sql server table

%3CLINGO-SUB%20id%3D%22lingo-sub-575842%22%20slang%3D%22en-US%22%3ESending%20powershell%20output%20to%20sql%20server%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-575842%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20new%20to%20powershell.%20Please%20help%20me.%20Currently%2C%20I%20am%20using%20the%20below%20code%20to%20send%20output%20to%20sql%20server%20table.%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22typ%22%3EFunction%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ECleanUp%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22typ%22%3EGet%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSProvider%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EFileSystem%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EWhere%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Ein%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E69.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E90%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EForEach%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EObject%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Echar%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%7D)%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ERemove%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24Csv%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EImport%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ECsv%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22path%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%20%20%0A%0A%24Csv%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EForEach%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EObject%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EBegin%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%24Letter%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E69%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%0A%0A%20%3CSPAN%20class%3D%22kwd%22%3Enew%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ERoot%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%20%24_%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EName%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Echar%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24Letter%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSProvider%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EFileSystem%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPersist%3C%2FSPAN%3E%20%0A%20%0A%20%20%20%3CSPAN%20class%3D%22kwd%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24Letter%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Elt%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E90%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%20%0A%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%0A%20%20%20%20%20%20%24Letter%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2B%2B%3C%2FSPAN%3E%20%0A%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%20%0A%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Eelse%3C%2FSPAN%3E%20%0A%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%20%0A%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22typ%22%3ECleanUp%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20%20%20%20%20%20%20%20%24Letter%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E69%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ECleanUp%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EPSDrive%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%0A%20%20%3CSPAN%20class%3D%22typ%22%3ESelect%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EObject%3C%2FSPAN%3E%20%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22File%20Share%20Name%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E'DisplayRoot'%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%7D%7D%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Total(GB)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Emath%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ERound%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E((%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Efree%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eused%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%2F%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E1GB%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E2%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%7D%7D%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Used(GB)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Emath%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ERound%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eused%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E1GB%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E2%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%7D%7D%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Free(GB)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Emath%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ERound%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Efree%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E1GB%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E2%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%7D%7D%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Total(%25)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Emath%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%5D%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ERound%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eused%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2F(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eused%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%24_%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Efree%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)*%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E100%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E2%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%7D%7D%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%40%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ename%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Date%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eexpression%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%7B(%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EGet%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EDate%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E).%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EToString%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E'MM-dd-yyyy'%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%7D%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%7C%3C%2FSPAN%3E%20%0A%20%20%0A%20%20%3CSPAN%20class%3D%22typ%22%3EWrite%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ESqlTableData%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eserverinstance%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22usalbsqldev002.logon.ds.ge.com%5Cdev002%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EDatabaseName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22FileShare%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ESchemaName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22dbo%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ETableName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22New1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eforce%0A%0A%0A%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-575842%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

I am new to powershell. Please help me. Currently, I am using the below code to send output to sql server table. 

Function CleanUp-PSDrive {
    Get-PSDrive -PSProvider FileSystem | Where { $_.Name -in (69..90 | ForEach-Object { [char]$_ })} | Remove-PSDrive
}$Csv = Import-Csv "path"   

$Csv.Name | ForEach-Object -Begin { $Letter = 69 } {

 new-PSDrive -Root  $_ -Name([char]$Letter) -PSProvider FileSystem -Persist 
 
   if ($Letter -lt 90) 
    { 
      $Letter++ 
    } 
    else 
    { 
        CleanUp-PSDrive        $Letter = 69
    }
} -End { CleanUp-PSDrive } | 
  Select-Object  @{name="File Share Name";expression={$_.'DisplayRoot'}}, @{name="Total(GB)";expression={[math]::Round(($_.free+$_.used)/1GB,2)}}, @{name="Used(GB)";expression={[math]::Round($_.used/1GB,2)}}, @{name="Free(GB)";expression={[math]::Round($_.free/1GB,2)}}, @{name="Total(%)";expression={[math]::Round($_.used/($_.used+$_.free)*100,2)}}, @{name="Date";expression={(Get-Date).ToString('MM-dd-yyyy')}} | 
  
  Write-SqlTableData -serverinstance "usalbsqldev002.logon.ds.ge.com\dev002" -DatabaseName "FileShare" -SchemaName "dbo" -TableName "New1" -force


 

 

0 Replies